CS 201: Exam 2 Info

Table of Contents

Notes sheet

You are permitted one 8.5 x 11 handwritten notes sheet (both sides) for use as a reference during the exam.

How to study

Lots of research has shown that reading over material on its own isn't a very good way to prepare for exams. The best thing to do is to practice. Reading how to swing a baseball bat or how to cross-country ski might give you some good ideas on how to get better the next time you try it, but it's not even close to just getting out there and swinging a bat or skiing in the Arb.

How can you practice? The textbook has a fantastic set of self-test exercises, that appear throughout the readings. The answers to the self-test exercises are at the end of the chapter. Practice these under test conditions and see how you do.

Additionally, at the end of every chapter is a set of exercises. Even though the solutions to those are not available, just trying to do them can be incredibly useful. The ones that involve programming you can put into the computer to see if they work. Otherwise, you can work with other students to see if you think you've got the right answers. Even if you don't know for sure if you've got the right answer, just practicing with these exercises can be helpful.

Finally, make sure to do all of your practicing on paper, not at a keyboard, so as to simulate the exam conditions.

Exam content

Listed below is the material that I have in mind that you should know for the exam. It's what's in my head when creating it. That said, this isn't a contract. I may have inadvertently left something off this list that ends up on an exam question. I make no guarantees that the exam will be 100% limited to items listed below. Moreover, I will not be able to test all of this material given the time limitations of the exam. I will have to pick and choose some subset of it.

Students should be able to do the following.

Java implementations of ADTs

  • List, Set, Dictionary/Map: show familiarity with these ADTs, what their operations are, and what they are used for.
  • Be able to explain what hash tables and binary search trees are used for. Be able to illustrate how standard operations (insert, delete, etc.) work. Be able to quantify performance (big-O) of standard operations. Show understanding of the ideas behind operations and big-O performance by being able to answer questions about novel variations on standard techniques.

Specifics regarding particular implementation approaches

  • Be able to distinguish between open addressing and separate chaining for hash tables. Know how they are implemented, and be able to consider tradeoffs between them. Be able to assess complexity (time and memory) of both approaches. Distinguish between a hash function, hash index, and hash key. Identify better vs. worse hash functions.
  • Be able to implement a binary search tree as a collection of nodes, and be able to show and/or implement how insert works. (Writing code for deleting won't be on this exam, but the algorithm for doing so is still potentially there.)
  • Be able to construct Java code to implement any reasonably-sized portion of the above implementation approaches or algorithms.
  • Be able to construct Java code to implement sets or maps via binary search trees or hashing (open addressing or chaining).
  • For linked lists, be able to handle doubly-linked and/or circular lists.

Usage of ADTs

  • Be able to use a list, set, or dictionary/map to solve a specified problem.

Java implementations

Recursion

  • Be able to code a recursive method in Java subject to specifications.
  • Be able to explain quantitatively (with big-O notation) tradeoffs in recursive vs. iterative solutions to a particular problem.
  • Be able to trace a recursive method and predict its output.
  • Be able to use backtracking to solve a problem as necessary.

Author: Dave Musicant

Validate