Red-Black TreesâAgain rank(x) = # black pointers on path from x to an external node. Same as #black nodes (excluding x) from x to an external node. rank(external node) =…