10.07.2015 Views

2-3-4 Trees and Red/Black Trees

2-3-4 Trees and Red/Black Trees

2-3-4 Trees and Red/Black Trees

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

‣ Implement private methods:– findMyUncle()– AmIaRightChild()– AmIaLeftChild()– RightRotate– LeftRotateHints• Need to change x's parent, y's parent, b's parent, x's right, y's left, x'sparent's left or right, <strong>and</strong> maybe root(-inf, inf)(-inf, inf)(-inf, y)xy(y, inf)cRightrotate of x(-inf, x)ax(x, inf)y(-inf, x) (x,y)a b© Copyright 2013 Brent Nash & Mark <strong>Red</strong>ekopp, All Rights ReservedLeft rotateof y(x, y)bc(y, inf)47

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

Saved successfully!

Ooh no, something went wrong!