225_41_union_find - 1....

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

View Full Document Right Arrow Icon
1 1. What is the parent array for the flat union/find data  structure for this graph? [the representative of each  component is the smallest numbered vertex in the component] 2 . Draw a picture of the  directed graph which  corresponds to the  union/find data  structure defined by the  parent array.
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Draw the directed graph that represents the flat union  find data structure defined by this parent array: 0 1 2 3 4 5 6 7 8 9 0 1 1 0 1 5 5 0 8 0 Show the updated parent array and also draw a  picture after  FLAT-UNION(4, 7).
Background image of page 2
Annoucements: Course evals Friday. Assignment #4 has been posted. It only has a written component and is due Friday  Nov. 18 at the beginning of class. Please check your final exam schedule for Wed. Dec. 7,  and Thurs. Dec. 8 (for scheduling a final exam  tutorial).
Background image of page 3

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

View Full DocumentRight Arrow Icon
4 How many connected components does a graph have  and which vertices are in each component? Algorithms: BFS, DFS or UNION/FIND
Background image of page 4
5 One algorithm that can use a union/find data structure:  Kruskal’s algorithm for finding a minimum weight  spanning tree. One application: A cable company must install cable to a new  neighbourhood. The cables are constrained to be buried  along certain paths. The cost varies for different paths. A  minimum weight spanning tree gives the cheapest way to  connect everyone to cable.
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Water distribution network
Background image of page 6
7 How can we determine quickly at each step whether adding  a new edge creates a cycle? Or equivalently, given an edge (u,v) are u and v in the same  component?
Background image of page 7

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

View Full DocumentRight Arrow Icon
8 The UNION/FIND data structure is a dynamic data  structure for graphs used to keep track of the connected  components.  It has 2 routines:  FIND(u):  returns the name of the component containing  vertex u  UNION(u, v):  unions together the components  containing u and v (corresponding to an addition of edge  (u,v) to the graph). 
Background image of page 8
9 The initialization for Approaches 1 and 2 is the same. 
Background image of page 9

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

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

Page1 / 25

225_41_union_find - 1....

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

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