Fall06Quiz1

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

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

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

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.

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. Kruskal’s 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 Prim’s algorithm and Dijkstra’s 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 Dijkstra’s algorithm....
View Full Document

## This note was uploaded on 02/10/2012 for the course CSE 5211 taught by Professor Dmitra during the Spring '12 term at FIT.

### 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
Ask a homework question - tutors are online