Reputation: 2085
The rules for a Red-Black Tree:
Rule 4 mentions that red nodes need both black childs but what if there is just one child to begin with? Is there an argument to prove or disprove this?
Upvotes: 4
Views: 3715
Reputation: 41
No,a red node cannot have one child,consider the following cases:- 1.If the single child it has is red...this cannot happen because no two consecutive nodes can be red. 2.If the child is black...again this cannot happen because this would violate the 'Black Height Rule'...this case would give one extra black node in a path which is not correct according to the rule.
Upvotes: 4