CSE 830: Design and Theory of Algorithms
Sample Questions for Exam #2
Spring 2008
1. Graph Traversal.
Given the following graph, determine the orders that both BreadthFirst
Search and DepthFirstSearch would traverse (mark as ‘discovered’) the vertices, starting from
‘A’. Break all ties in alphabetical order.
2. Switching Underlying Data Types.
Give an O(n
2
) algorithm to convert from an adjacency
matrix to adjacency lists.
3. Bipartite Gaphs.
If the maximum degree in a graph is 2, must it be bipartite? If a graph has
cycles of only even length, must it be bipartite? Prove or give a counter example for each.
4.
Hamiltonian paths.
A Hamiltonian path is a simple path that passes through every vertex in a
graph exactly once. Finding a Hamiltonian path in an arbitrary graph can be hard, but in a DAG
(directed acyclic graph), it can be found (or decided that no such path exists) in only O(
n
+
m
)
time. Describe how this is possible.
5.
Vertex Cover.
The vertex cover problem (choosing a minimum set of vertices where each
edge has at least one vertex in the set) is known to be a hard problem, but some instances of it are
solvable in polynomial time. Describe three such algorithms if we know that the graph is
(a)
a
ring (a connected graph where all vertices are degree 2.),
(b)
a tree. or
(c)
a grid.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '08
 OFRIA
 Algorithms, Graph Theory, NPcomplete problems, Mr. Sam, Mr. Fudd

Click to edit the document details