






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 fall 2007 cmsc132 midterm 1 exam for computer science students. It includes multiple choice and fill-in-the-blank questions on java language features, program correctness, algorithm complexity, hashing, linear data structures, and sets and maps.
Typology: Exams
1 / 10
This page cannot be seen from the preview
Don't miss anything!







a. (8 pts) Calculate the asymptotic complexity of the code snippets below (using big-O notation) with respect to the problem size n.
a. (4 pts) Hash tables Assuming the following hash values are computed for the keys A, B, C, D, and E: H(A) = 4, H(B) = 3, H(C) = 3, H(D) = 3, H(E) = 0 Rewrite the following two hash tables to illustrate the state of each table after A, B, C, D, and E have been inserted in the table (in the specified order). Open addressing Chaining (bucket hashing) b. (4 pts) Load factor
You are asked to use the HashSet and HashMap classes to implement a TVPrograms class to track the set of channels running a show. The class must also be able to report the set of shows running on each channel. public class TVPrograms { private Map<String, Set
You may find the following Map methods helpful: V get (Object key) - Returns the value to which this map maps the specified key. V put (K key,V value) - Associates the specified value with the specified key in this map. Set
a. (6 pts) True or False (1pt each)