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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Lecture 10 - tree restructuring<br />

Listen To Part 10-5<br />

To get a linear algorithm, we must beware of trees like:<br />

<strong>The</strong> correct answer is that n-1 rotations suffice to get to a rightmost chain.<br />

By picking the lowest node on the rightmost chain which has a left ancestor, we can add one node per rotation to the right<br />

most chain!<br />

Initially, the rightmost chain contained at least 1 node, so after 1 rotations it contains all n. Slick!<br />

Listen To Part 10-6<br />

file:///E|/LEC/LECTUR16/NODE10.HTM (4 of 9) [19/1/2003 1:34:50]<br />

Red-Black Insertion

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

Saved successfully!

Ooh no, something went wrong!