
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

CMPS 101 Practice Exam 2
CMPS 101 Practice Exam 2 Oct. 31, 2001
100 Points Total Closed book, + Master Theorem Answer on this Exam
1 ADTs, Big-, Sums, Recurrences, Master Thm, Unix, Editor
Similar to midterm 1.
2 Depth First Search
A. On a sample graph given by a picture, show the discovery and finishing times of each node, and show which are the tree edges. Also, classify the non-tree edges as back, cross, or descendant.
B. Describe an algorithm (a) to determine whether a directed graph has a cycle; (b) find the connected components
of an undirected graph; (c) similar simple problems. In all “describes” you would say how you insert code into a DFS
skeleton.
C. Illustrate the evolution of the SCC algorithm on a graph given in a picture (similar to study questions and examples
on blackboard). Show the depth first spanning forests built by both DFS(G) and DFS(GT^ ), plus discovery and finishing
times.
Circle or otherwise clearly indicate the SCCs.
Draw the component graph. This is also called the reduced graph and condensation graph.
D. Give the asymptotic order (big ) for SCC on a graph of n nodes and m edges.
E. In part C, which nodes are leaders of their SCCs? Why?
3 Topological Order
A. For what kind of graphs is a topological order defined?
B. Find a topological order for a graph given in a picture, the size being similar to part C of the previous question.
4 Other study questions
Exercises 7.4a, 7.5a, 7.9, 7.10, 7.11a, 7.12b, 7.16, 7.17 (use dfs for a), 7.23a, 7.24b.
CMPS 101 Fall, 2001 1 Handout 11