18.04.2013 Views

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

The.Algorithm.Design.Manual.Springer-Verlag.1998

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Lecture 17 - minimum spanning trees<br />

Assume true to k-1 nodes. Let be the height of the tree<br />

If then<br />

If , then .<br />

Listen To Part 19-9<br />

Can we do better?<br />

We can do unions and finds in , good enough for Kruskal's algorithm. But can we do better?<br />

<strong>The</strong> ideal Union-Find tree has depth 1:<br />

On a find, if we are going down a path anyway, why not change the pointers to point to the root?<br />

This path compression will let us do better than for n union-finds.<br />

file:///E|/LEC/LECTUR16/NODE17.HTM (10 of 11) [19/1/2003 1:35:14]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!