This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 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 Breadth-First- Search and Depth-First-Search 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....
View Full Document
This note was uploaded on 07/25/2008 for the course CSE 830 taught by Professor Ofria during the Spring '08 term at Michigan State University.
- Spring '08