void printtreeconst ifheader->right =nullnode cout <"empty tree<endlelse printtreeheader->right )void printtreeredblacknode * const ift ! ->left printtreet->left )cout element <endlprinttreet->right )redblacktreeconst redblacktree rhs nullnode new redblacknodenullnode->left nullnode->right nullnodeheader header->left header->right new redblacknoderhs header->element }nullnodeclonerhs header->right )redblacknode cloneredblacknode const ift = ->left /cannot test against nullnode!!return nullnodeelse return new redblacknodet->elementclonet->left )clonet->right ) ->color }figure tree traversals with two sentinelsprinttree and copy constructor deletion of red leaf isof coursetrivial if leaf is blackhoweverthe deletion is more complicated because removal of black node will violate condition the solution is to ensure during the top-down pass that the leaf is red throughout this discussionlet be the current nodet be its siblingand be their parent we begin by coloring the root sentinel red as we traverse down the treewe attempt to ensure that is red when we arrive at new nodewe are certain