
CS 303L Data Structure and Algorithm
March 20, 2008
Homework 5
(Due on March 27, 2008)
1. How do you tell, by looking at its adjacency matrix, how many edges there are in an
undirected graph?
2. If an adjacency matrix has rows [0,1,0,0], [1,0,1,1], [0,1,0,0], and [0,1,0,0], what is the
corresponding adjacency list?
3. How many different minimum spanning trees are there in an undirected graph of three
vertices and three edges?
4. True/False
a. A minimum spanning tree for an undirected graph has cycles.
b. A tree has no cycles.
c. In a graph, a vertex must connect two edges.
d. In a graph, an edge must connect two vertices.
e. In a game simulation, the choice about what move to make corresponds to the
nodes in a graph.
5. Multiple choice:
a. A minimum spanning tree is a graph in which
i. The number of edges connecting all the vertices is as small as possible.
ii. The number of edges is equal to the number of vertices.
iii. All unnecessary vertices have been removed.
iv. Every combination of two vertices is connected by the minimum number of
edges.
b. An undirected graph must have a cycle if
i. Any vertex can be reached from some other vertex.
ii. The number of paths is greater than the number of vertices.
iii. The number of edges is equal to the number of vertices.
iv. The number of paths is less than the number of edges. ABCFGDEHJIKLM