



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




First Name (PRINT): ___________________________________________________ Last Name (PRINT): ___________________________________________________ University ID: _________________________________________________________ I pledge on my honor that I have not given or received any unauthorized assistance on this examination. Your signature: ______________________________________________________________ Instructions ๏ This exam is a closed-book and closed-notes exam. ๏ Total point value is 100 points, 50 minutes exam. ๏ Please use a pencil to complete the exam. ๏ PUNT RULE: For any question, you may write PUNT, and you will get ยผ of the points for the question (rounded down). If you feel totally lost on a question, you are encouraged to punt rather than write down an incorrect answer in hopes of getting some partial credit. ๏ WRITE NEATLY. If we cannot understand your answer, we will not grade it (i.e., 0 credit)._ Grader Use Only #1 Algorithmic Complexity (18) #2 Program Correctness (10) #3 Hashing (8) #4 Language Features (24) #5 Sets and Maps (20) #6 Linear Data Structures (20) Total (100)
a. (6 pts) Calculate the asymptotic complexity of the code snippets below (using big-O notation) with respect to the problem size n.
Problem 2 (10 pts) Program Correctness and Exceptions
public class Assistants { Map<String, Set
map = new HashMap<String, Set
Set
for (String c : map.keySet()) { System. out .println(c); for (String taName: map.get(c)) System. out .println(taName); } Problem 6 (20 pts) Linear Data Structures
public ArrayList