




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions and questions for the midterm 1 exam of the cmsc132 course offered in spring 2008. The exam covers topics such as algorithmic complexity, program correctness, hashing, java language features, and sets and maps. Students are required to answer short answer questions related to these topics, and the exam is closed book and closed notes. The document also includes information about grading, rules, and exceptions.
Typology: Exams
1 / 8
This page cannot be seen from the preview
Don't miss anything!





public void test() { f(); }
public class Col { private ArrayList c; public String get() { return c.remove(0); } public void insert(String value) { c.add(value); } }
String[] names = {"John", "Kate", "Laura"}; for (int i=0; i < names.length; i++) System.out.println(names[i]);
Honors Section problems are on the reverse
Java provides two different standard implementations of the List interface: LinkedList and ArrayList.
complexity on a LinkedList than on an ArrayList. What are the complexities in each implementation? Don’t worry if you don’t remember the exact method name, just describe what the method does.
than on a LinkedList. Name/describe the operation, and give the asymptotic complexity in each implementation.
asymptotic complexity either List implementation than on a HashSet. Name/describe the operation, and give the asymptotic complexity in List implementations, and in HashSet.