Q1: 10 points Q2: 10 points Q3: 15 points Q4: 15 points Q5: 20 points Q6: 30 points Total: 100 points
(Recall the definition of the Θ symbol. If f and g are functions, "f = Θ(g)" means that both f = O(g) and f = Ω(g) are true. Thus "T(i) = Θ(i)" means that there are two constants c and d, with c > d > 0, such that for sufficiently large i (i greater than some i0), T(i) satisfies di2 ≤ T(i) ≤ ci2. When you show that the total time is Θ(n3), you may assume that n is sufficiently large relative to i0.)
Carefully describe the result of a breadth-first search and a depth-first search of Kn. For each search, describe the tree and indicate where there are non-tree edges. (There are choices made during the course of each search, but it turns out that these choices do not affect the shape of either tree.)
It may help to draw the result of BFS and DFS on the graph K4 or K5 before attempting to describe the general case.
We need to place a sign in each town indicating the distance from it to Boston by the shortest route along the edges. Describe an algorithm to find this distance for each town, and give a big-O bound on this algorithm's running time in terms of n.
Prove that your algorithm takes no longer than any other algorithm. You should probably use mathematical induction.
Last modified 28 September 2006