本文整理汇总了C++中delete_tree函数的典型用法代码示例。如果您正苦于以下问题:C++ delete_tree函数的具体用法?C++ delete_tree怎么用?C++ delete_tree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete_tree函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: delete_tree
void delete_tree(tree root)
{
if (NULL != root) {
delete_tree(root->child);
delete_tree(root->next);
free(root);
}
}
示例2: delete_tree
void delete_tree(Tree * t)
{
if (!t) return;
if (t->left) delete_tree(t->left);
if (t->right) delete_tree(t->right);
delete t;
}
示例3: delete_tree
/**
* Deletes the tree from node n and gives the memory back
* to free heap space.
*/
void delete_tree(node** n) {
if(*n != NULL) {
delete_tree(&((*n)->left));
delete_tree(&((*n)->right));
free((*n)->word);
free(*n);
*n = NULL;
}
}
示例4: delete_tree
void delete_tree(tnode_t **tree) {
if (*tree == NULL) return;
delete_tree(&(*tree)->lchild);
delete_tree(&(*tree)->rchild);
free(*tree);
*tree = NULL;
}
示例5: delete_tree
void delete_tree(tree_node* parent) {
if(parent->right_child)
delete_tree(parent->right_child);
if(parent->left_child)
delete_tree(parent->left_child);
if(parent->points)
free(parent->points);
free(parent);
}
示例6: delete_tree
void FAGeneral::delete_tree(Group *g){
Group *gfdown = g->fatherdown;
if (gfdown!= NullGroup){
gfdown->childup = 0;
}
Group *g1=g->childup,*g2=g->childdown;
if(g1 != NullGroup)delete_tree(g1);
if(g2 != NullGroup)delete_tree(g2);
delete g;
}
示例7: delete_tree
void delete_tree(Node *& treeRoot)
{
if (treeRoot == nullptr)
return;
delete_tree(treeRoot->left);
delete_tree(treeRoot->right);
treeRoot->parent = nullptr;
delete treeRoot;
treeRoot = nullptr;
}
示例8: delete_tree
/**
* 回收构造树的内存空间
*/
void delete_tree(pnode & root)
{
if(root != NULL)
{
delete_tree(root->lchild);
delete_tree(root->rchild);
cout << "free the node " << root -> value << endl;
delete root;
root = NULL;
}
}
示例9: delete_tree
/** @function delete_tree(leaf *root)
@brief Delete tree
@param *root
*/
void delete_tree(leaf *root)
{
if(!root) return;
delete_tree(root->son_l);
delete_tree(root->son_r);
if(root->val)
{
printf("\n....destroy (%d)", root->val);
delete root;
}
}
示例10: delete_tree
void delete_tree(node * current)
{
if(current==NULL)
{
return;
}
else
{
delete_tree(current->lchild);
delete_tree(current->rchild);
free(current);
}
}
示例11: delete_tree
int delete_tree(tree_node* root)
{
static int deleted_nodes = 0;
if (root == NULL)
return 0;
delete_tree(root->left);
delete_tree(root->right);
free(root);
return ++deleted_nodes;
}
示例12: delete_tree
static void delete_tree( rbt_tree *tree, node_type *p )
{
tag_type *rbt = ( tag_type * )tree;
// Erase nodes in depth-first traversal.
if ( p == &rbt->sentinel )
{
return;
}
delete_tree( tree, p->left );
delete_tree( tree, p->right );
free( p );
}
示例13: delete_tree
void delete_tree(NODE *root)
{
if(root->left!=NULL)
{
delete_tree(root->left);
}
if(root->right!=NULL)
{
delete_tree(root->right);
}
free(root);
}
示例14: delete_tree
void delete_tree(NODE *root)
{
if(root->previous!=NULL)
{
delete_tree(root->previous);
}
if(root->next!=NULL)
{
delete_tree(root->next);
}
free(root);
}
示例15: delete_tree
void delete_tree(NODE *root)
{
if(root->left_child!=NULL)
{
delete_tree(root->left_child);
}
if(root->right_child!=NULL)
{
delete_tree(root->right_child);
}
free(root);
}