I was reading the red black tree tutorial from Eternally confuzzled.
In the part where author explains the deletion of the nodes from a RB tree, authors asks readers to find the explanation as exercise:
It's obvious after seeing a diagram how this restores balance by fixing the black heights, but it's confusing why 2 becomes red. Well, the red has to go somewhere or the black height of the tree would be affected, and the only known node that we are sure can be made red is that particular child. I don't quite remember how I figured out the red sibling cases, but I'm reasonably sure that alcohol was involved. :-) The second red sibling case looks at the inner child of the sibling. This child cannot be a null pointer (exercise: why?), so we simply test one of its children and act depending on which one is red. If the outer child is red, we perform a double rotation, color the new parent black, its right child black, and its left child red:
How did the author conclude that the inner child of the sibling cannot be a null pointer? Why that particular child cannot be null pointer ? Why not the other child ?