CS201 Data Structures Wednesday, 13 February 2019 1. Exam Possible: 55 High: 52 A- to A: 47-55 (8 people) B- to B+: 37-46 (14 people) C- to C+: 25-36 (9 people) Other: (3 people) You may redo the exam as a take-home - You may speak with me and Kate, but nobody else - You may use your book, computers, the internet, etc. - Due on paper at the beginning of class, Friday 2/15 - Hand it in as a clean, typed (not hand-written) document. - I'll use the average of your in-class and take-home scores as your score - Caveat: If you have an asterisk on your paper, I'll weight your score on problem #4 as 3/4 take-home + 1/4 in-class. [Thoughts: - This exam did not reward "close-but-not-quite" understanding - I graded pretty strictly on "kind-of-but-not-really" prose answers - A couple problems with the exam itself: #1, #4 - Importance of readings - Importance of experimentation with Java concepts - Importance of labs and examples What are the lessons I'm trying to get you to learn? - You all know some stuff. You are all poised to be able to do sophisticated programming and algorithm analysis. - Be persistent, put in the time, keep track of your questions, explore and experiment, and use your resources (especially me and Kate) ] 2. Break, shake it off 3. Searching - What does "searching" mean in computer science/programming? collections objects and their search keys - When is searching important? (Examples?) - Super-simple case: Collection: ArrayList Search key: String [looking for an exact match] What's the most obvious thing to do? What's the obvious thing called? How fast is it? (Use Big-O notation, with N=number of items in the collection) - Slightly more complicated: Collection: ArrayList Search key: String [looking for an exact match with familyName] - Be smarter: Collection: ArrayList, sorted lexicographically (i.e. alphabetically) Search key: String [exact match] Now what? What's that called? How fast is it? (Big-O, N=collection size) - And again: Collection: ArrayList, sorted lexicographically by familyName, using givenName then birth date in case of identical familyName. Search key: String [looking for an exact match with familyName] - What does this look like in Java? "Comparable" example SearchableCollection interface LinearSearchableCollection You're implementing LinearSearchableCollection. - How are you going to test it? - What are you going to implement, and in what order?