Exam2 will be on April 2nd(Thursday). Topics will include:
- Big-O complexity. KNOW THE DEFINITIONS for O, Omega, Theta. Not everyone got this right on the first exam, so I'm going to ask the EXACT SAME QUESTIONS. No excuse for not getting this right!
- Greedy knapsack.
- Greedy event scheduling.
- Be able to sketch pseudocode for both greedy knapsack and event scheduling.
- Can you think of an example where the greedy knapsack would NOT get the optimal answer, if we have to take an item in it's entirety (the 0-1 knapsack problem).
- Huffman codes. Given a set of letters and their frequency, be able to construct an optimal Huffman tree.
- Given a Huffman tree, be able to convert a series of letters to a stream of 1s and 0s. And from 1s and 0s, go to letters.
- Graphs -- be able to sketch an abstract data structure (not a matrix).
- Be able to sketch actual code for how you would implement the graph. You must have used a class or structure in either C or C++. It should be easy for you to show what you did.
- Breadth first search. Be able to sketch pseudocode. Given a graph, be able to describe the order that vertices are visited.
- Depth first search; same sorts of things.
- Be able to sketch pseudocode for counting the number of connected components in a graph. You can assume you have a function called either "DFS" or "BFS".
- Disjoint set data structures. Given an array with "parent" information -- how many sets are there? What is in each set? If you did a merge, how does the DJS change?
- Be able to sketch pseudocode for DJS merge, find_set.
- Know what path compression is for DJS, be able to demonstrate what happens on find.
- Kruskal's algorithm. Be able to sketch pseudocode, list the edges that would be added to a tree in the correct order.
- Prim's algorithm. Be able to sketch pseudocode, list the edges that would be added to a tree in the correct order.
Exam2 from CS333, Spring 2006 is available too. We're covering some things in different order this semester, but this should give you a rough idea of what to expect.
NOTE: there have been questions on Quicksort and the Hoare partition function in prior exam 2s -- we're not covering that with this exam, for this semester (Spring 2009).
An old practice exam.
We used the practice exam previously during a review; photos from working through that are below.