Algorithms and Data Structures - Homework 5 | CS 303, Assignments of Computer Science

Material Type: Assignment; Class: Algorithms and Data Structures; Subject: Computer Science; University: University of Alabama - Birmingham; Term: Spring 2008;

Typology: Assignments

Pre 2010

Uploaded on 04/12/2010

koofers-user-pc2-1
koofers-user-pc2-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
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

Partial preview of the text

Download Algorithms and Data Structures - Homework 5 | CS 303 and more Assignments Computer Science in PDF only on Docsity!

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