Question: A red - black tree is a binary - search tree such that the following hold: 1 . Every node is either red or black.

A red-black tree is a binary-search tree such that the following hold:
1. Every node is either red or black.
2. The root and the leaves are black.
3. If a node is red, then both its children are black.
4. For each node, all simple paths from the node to descendant leaves have the same
number of black nodes.
(a)(5 points) Draw a red-black tree with the keys 6,18,10,28,8,12 so that no two internal
nodes contain the same key, and that the black height of the tree is 2. Make sure that
the nodes with the keys 8 and 28 are red. What is the height of this tree? Please explain
briefly.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!