Recursive Implementations 2
static void RRelease(Node* n)
// post: all descendants of n have been deleted
{
if (n != nullptr)
{
if (n->lchild_ != nullptr)
{
RRelease(n->lchild_);
delete n->lchild_;
n->lchild_ = nullptr;
}
if (n->rchild_ != nullptr)
{
RRelease(n->rchild_);
delete n->rchild_;
n->rchild_ = nullptr;
}
}
}