COP 3530 Midterm: COP 3530 FIU Exam1 sum09
37 views5 pages
Document Summary
There will be no deductions for lack of commenting. There will be no deductions for lack of import directives. There will be no deductions for minor syntax errors: [50 points] containsall, shown below, returns true if the rst list contains all the elements in the second list. Assume the lists are approximately the same size and have about n items each. public boolean containsall( list bigger, list items ) outer: for( int i = 0; i < bigger. size( ); i++ ) Integer itemtofind = bigger. get( i ); for( int j = 0; j < items. size( ); j++ ) if( items. get( j ). equals( itemtofind ) ) // match continue outer; How long will it take to run equals on two equally-valued 2000-item arraylists? (d) explain in one sentence how to make the algorithm e cient for all types of lists. 1: [50 points] this question requires that you implement some methods for a class that represents a doubly- linked list.
Get access
Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers