CPSC 221H: Data Structures & Algorithms
Information and Review Questions for Exam 3
Spring 2009


General Information

The third exam will be on Friday May 8, 2009 from 3pm-5pm in the classroom (during the final exam slot).

The third exam will cover material from Chapters 10 and 12 in the text. It will be a closed book exam (no notes, books, or neighbors) except you will be allowed a one page (8.5x11), two-side cheat sheet which must be turned in with the exam. There will be 5 questions, each worth 20 points, for a total of 100 points. Remember to show your work - partial credit will be given.


Material

All of the following are considered to be fair game:


Review Questions

Below are some suggested review exercises/problems for the exam. It is strongly recommended that you be able to do all of these problems. Solutions will not be handed out. Finally, be sure to check your email -- clarifications and/or explanations will be mailed to the class if needed.

  1. Study Homeworks 8-11, Quizzes 8-11, and the in class assignments; variations of some of these questions will appear on the exam.

  2. Sorting and Selection. Consider the following comparison-based sorting algorithm.
    New-Sort(array L of integers)
       if (L has more than 1 element)
             x := Magic-Median(L);  /* find median element in L  */
    	 Magic-Partition(x,L);  /* partition around median x */
    	 New-Sort(1st half of L);
    	 New-Sort(2nd half of L);
        endif
        return L;
    end /*New-Sort*/
    

  3. Graph Representation and traversal.
  4. Minimum Spanning Trees (MSTs). Let G=(V,E) be a connected, undirected, weighted graph. Know Kruskal's, Prim-Jarnik's, and Baruvka's algorithms for MSTs.

  5. Shortest Paths. Know Dijkstra's and Bellman-Ford single-source shortest path (SSSP) algorithms. Also, know the topological sort-based SSSP algorithm that can be applied to DAGs.