Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Final Practice Problems
These problems are ungraded, and are intended as a study aid. They are very similar in
style and level to the problems that will appear on the final. The final exam will have between
6 and 8 problem (including the true/false question).
The final covers all the material until lecture 23 (including all the material covered by HW1
through HW6), with a bigger emphasis on the post-midterm material. There final is 2h30min.
Like in midterm, most problems won’t require full analysis (correctness + runtime); instead
each problem will ask explicitly which part of the analysis, if any, is required.
Problem 1 (DFS) If we perform depth-first-search on graph, we obtain a forest containing
all the vertices of the graph and a subset of the edges. Each node u has a “discovery time” u.d
and a “finish time” u.f . We consider the possible relationships between the intervals [u.d, u.f ]
and [v.d, v.f ] for two distinct vertices u and v.