| | | | | |

Recursive Implementations 2

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

| | Top of Page | 12. Binary Search Trees - 20 of 27