I'm reading Introduction to Algorithms, 3rd Edition (ISBN-10: 9780262033848) and in it is the following algorithm to "fix" a red-black tree after the insertion of a red node.
On line 3 it says to set y = to 'z's parent's parent's right child' (z's right uncle). My question is, what if z is only the third insertion and it is a left child of a left child? Wouldn't there need to be another case that handles z not having a right uncle but its parent being a red left child?
gp (blck)
/
p (red)
/
z (red)