void FreeTree(BinNode * root)
{
if (root == NULL)
return;
if (root->lchild != NULL)
{
FreeTree(root->lchild);
root->lchild = NULL;
}
if (root->rchild != NULL)
{
FreeTree(root->rchild);
root->rchild = NULL;
}
if (root != NULL)
{
free(root);
root = NULL;
}
}
释放树
最新推荐文章于 2022-05-20 00:48:09 发布