Let us define a relaxed red-black tree as a binary search tree that satisfies red-black properties 1, 3, 4, and 5. In other words, the root may be either red or black. Consider a relaxed red-black tree \(T\) whose root is red. If we color the root of \(T\) black but make no other changes to \(T\), is the resulting tree a red-black tree?
Yes. Let us consider each property:
- We have introduced no new color, so this property holds.
- We just satisfied this property by coloring the root node black.
- This must have been true for our relaxed red-black tree and so it must still be true after we change the root’s color.
- This property ensures that our root has two black children, which is still acceptable with a black root node. Since we have introduced no new red nodes, this property holds.
- The only way we would have invalidated this property is by modifying some simple paths of a node without modifying some other paths of that same node. The root node is only contained within simple paths that originate from the root itslef and so this property must still hold.