24.12.2013 Views

․Course ․Readings:

Unit-3.pdf

Unit-3.pdf

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.

Deletion Color Fixup<br />

․If y is black, we must give each of its descendants<br />

another black ancestor push y's blackness onto its<br />

child x.<br />

․If an appropriate node is red, simply color it black; must<br />

restructure, otherwise.<br />

Black NIL becomes doubly black.<br />

Red becomes black.<br />

Black becomes doubly black.<br />

․Goal: Recolor and restructure the tree so as to get rid of<br />

doubly black.<br />

․Key: Move the extra black up the tree until<br />

x points to a red node, simply color it black.<br />

x points to the root, the extra black can simply be removed.<br />

Suitable rotations and recolorings can be performed.<br />

Unit 3 Spring 2013<br />

22

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

Saved successfully!

Ooh no, something went wrong!