Docsity

CMPS 101 Practice Exam 2 - Computer Science Fundamentals, Exams of Computer Science

Toggle sidebar
bg1
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 graphhas 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(
G
T
), 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.
m
A
m
B
m
C
m
D
m
E
m
F
-
?
6
-
m
A
m
B
m
C
m
D
m
E
m
F
-
?
6
-
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 orderdefined?
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 1Handout 11

Partial preview of the text

Download CMPS 101 Practice Exam 2 - Computer Science Fundamentals and more Exams Computer Science in PDF only on Docsity!

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.

A^ m Bm Cm

D^ m Em Fm

A^ m Bm Cm

D^ m Em Fm

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