Fall06Quiz1

Fall06Quiz1 - true or false. 4. Suppose that e is a minimum...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Quiz CSE 4081/5211 Fall 2006 12 points 15 minutes 9/19/06 Key . Indicate for each of the following if it is true or false. (Remember, a statement is true only if it is true in all instances.) 1. There is an algorithm to determine whether a given undirected graph on n nodes is a tree that runs in O(n) time. True. Run DFS or BFS, terminate as soon as a visited node is touched the second time. 2. Suppose that G is a connected, undirected graph. If removing edge e from G disconnects the graph, then e is a tree edge in the depth-first search of G . True. DFS starting from any node on either side of the edge e will have to visit e. 3. Let G = ( V, E ) be a directed graph, where ( u, v ) E . If in a depth-first search on G the edge ( u, v ) is a cross edge between two distinct dfs trees, then u is visited before v . False. Cross edge are right to left. (v, u) is in E, not (u, v). For the following problems, let G be an undirected, positive number- weighted graph that is connected. Indicate whether each statement is
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: true or false. 4. Suppose that e is a minimum weight edge G , and all the edge weights are distinct. Then e is always contained in the minimum spanning tree of G . True. Kruskals algorithm will start with this edge. 5. The path between a pair of vertices in a minimum spanning tree for G must be a shortest (i.e., least-cost) path between the two vertices in G . False. Note the difference between Prims algorithm and Dijkstras algorithm. You can create a counter-example. 6. Suppose we run Dijsktra's algorithm on G starting at some vertex, s . Recall that at each step of the algorithm, we add another vertex to the set S . Suppose we add vertex u to S before we add the vertex v to S . Then the distance from s to u in G is no greater than the distance from s to v . True. Note the proof of Dijkstras algorithm....
View Full Document

Page1 / 2

Fall06Quiz1 - true or false. 4. Suppose that e is a minimum...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online