2014-05-13

Practice Final #4.

Originally Posted By: Acmoody
What are the red black properties?

1. every node is either red or black
2. Root is black
3. Every leaf (Nil) is black
4. If a node is red, then both children are black
5. For each node, all simple paths from the node to descending leaves contains the same number of black nodes


..........(11) Black
............/ \
......(9) red (12) red
......./
(4) redAcmoody — Tue May 13, 2014 11:38 pm <hr>
'''Originally Posted By: Acmoody''' What are the red black properties?<br><br>1. every node is either red or black<br>2. Root is black<br>3. Every leaf (Nil) is black<br>4. If a node is red, then both children are black<br>5. For each node, all simple paths from the node to descending leaves contains the same number of black nodes<br><br> <br>..........(11) Black<br>............/ \<br>......(9) red (12) red<br>......./<br>(4) redAcmoody &mdash; Tue May 13, 2014 11:38 pm <hr>
2014-05-18

-- Practice Final #4
Originally Posted By: kohdmonkey
I think there is an error in this solution. Adding 4 will simply cause 9 and 12 to be repainted to black, no rotations occur. Adding an additional 2 will cause a right rotation on the left subtree with 4 becoming the child of 11.
'''Originally Posted By: kohdmonkey''' I think there is an error in this solution. Adding 4 will simply cause 9 and 12 to be repainted to black, no rotations occur. Adding an additional 2 will cause a right rotation on the left subtree with 4 becoming the child of 11.
X