UML CS
Analysis of Algorithms
91.404 (section 201)
Fall, 2011
1 of 2
Homework Set #10
Assigned: Monday, 12/5
Due: Monday, 12/12 (start
of lecture)
This assignment covers textbook material in Chapters 2223.
Note
: Partial credit for wrong answers is only given if work is shown.
For this assignment, use the BFS procedure on p. 595 of our textbook and the DFS procedure on p. 604
instead of the pseudocode in the class handout.
1
.
(25 points) For the
undirected, unweighted
graph G1 in Figure 1:
a) (3 points) Show an adjacency list
representation of G1. Use lexicographic ordering.
b) (2 points) Is an adjacency list representation better for G1 than an adjacency matrix?
Justify your
answer.
c) (5 points) Draw the BreadthFirst Search tree consisting of tree edges that result from
a BreadthFirst Search of G1 with node A as the source.
d) (5 points) For each node reachable from A, show the shortest path in G1 from
A to that node.
Give the length (i.e. number of edges) of each such shortest
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.
 Fall '09
 DR.KARENDANIELS
 Algorithms, Graph Theory, g2, adjacency list representation

Click to edit the document details