This preview shows pages 1–2. Sign up to view the full content.
CS 473
Midterm 2 Questions — Version
β
Spring 2010
This exam lasts 120 minutes.
Write your answers in the separate answer booklet.
Please return this question sheet with your answers.
1. Find the following spanning trees for the weighted graph shown below.
(a) A depthﬁrst spanning tree rooted at
s
.
(b) A breadthﬁrst spanning tree rooted at
s
.
(c)
A shortestpath tree rooted at
s
.
Oops!
(d) A minimum spanning tree.
s
1
2
3
4
10
1
6
8
9
7
5
You do
not
need to justify your answers; just clearly indicate the edges of each spanning tree in
your answer booklet. Yes, one of the edges has negative weight.
2.
[Taken directly from HBS 6.]
An
Euler tour
of a graph
G
is a walk that starts and ends at the same
vertex and traverses every edge of
G
exactly once.
Prove
that a connected undirected graph
G
has
an Euler tour if and only if every vertex in
G
has even degree.
3. You saw in class that the standard algorithm to I
NCREMENT
a binary counter runs in
O
(
1
)
amortized
time. Now suppose we also want to support a second function called R
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 '08
 Chekuri,C

Click to edit the document details