midterm2(1) - CS 473 Midterm 2 Questions Version Spring...

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

View Full Document Right Arrow Icon
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-first spanning tree rooted at s . (b) A breadth-first spanning tree rooted at s . (c) A shortest-path 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
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

midterm2(1) - CS 473 Midterm 2 Questions Version Spring...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online