本文整理汇总了C++中delete_tree函数的典型用法代码示例。如果您正苦于以下问题:C++ delete_tree函数的具体用法?C++ delete_tree怎么用?C++ delete_tree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了delete_tree函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: delete_tree
void delete_tree(tree root)
{
if (NULL != root) {
delete_tree(root->child);
delete_tree(root->next);
free(root);
}
}
开发者ID:uecker,项目名称:toys,代码行数:9,代码来源:baum.c
示例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;
}
开发者ID:kharvd,项目名称:labs,代码行数:9,代码来源:tree.cpp
示例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;
}
}
开发者ID:Robotregent,项目名称:system-soft,代码行数:13,代码来源:wordcounter.c
示例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;
}
开发者ID:Eckankar,项目名称:OSM-G,代码行数:9,代码来源:bintree.c
示例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);
}
开发者ID:caomw,项目名称:kd-trees,代码行数:9,代码来源:build_tree.cpp
示例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;
}
开发者ID:rforge,项目名称:fusedanova,代码行数:10,代码来源:withsplit.cpp
示例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;
}
开发者ID:EkardNT,项目名称:CS165,代码行数:10,代码来源:bst.cpp
示例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;
}
}
开发者ID:liuyueyi,项目名称:AccessTree,代码行数:14,代码来源:AttributeTree.cpp
示例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;
}
}
开发者ID:KateLiliy,项目名称:Laba4,代码行数:16,代码来源:tree.cpp
示例10: delete_tree
void delete_tree(node * current)
{
if(current==NULL)
{
return;
}
else
{
delete_tree(current->lchild);
delete_tree(current->rchild);
free(current);
}
}
开发者ID:sandeepveethu,项目名称:DS-Course-Scripts,代码行数:13,代码来源:bintree_duplicate.c
示例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;
}
开发者ID:bit0001,项目名称:Practical-Programming-in-C,代码行数:13,代码来源:binary_tree.c
示例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 );
}
开发者ID:abdellahB,项目名称:thumbs-viewer,代码行数:14,代码来源:rbt.cpp
示例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);
}
开发者ID:monishcse982,项目名称:MISSION-R-D-CODE,代码行数:14,代码来源:S5Q8.cpp
示例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);
}
开发者ID:monishcse982,项目名称:MISSION-R-D-CODE,代码行数:14,代码来源:S5Q6.cpp
示例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);
}
开发者ID:monishcse982,项目名称:MISSION-R-D-CODE,代码行数:14,代码来源:S5Q7.cpp
示例16: delete_tree
void delete_tree(TreeNode **n)
{
if((*n) == NULL)
return;
if((*n)->left != NULL)
delete_tree(&((*n)->left));
if((*n)->right != NULL)
delete_tree(&((*n)->right));
free(*n);
*n = NULL;
}
开发者ID:kunalnarsinghani,项目名称:Interview,代码行数:14,代码来源:BSTConnectSiblings.c
示例17: delete_tree
static void delete_tree(struct huffman_node *node)
{
struct huffman_node *left, *right;
if (node == NULL)
return;
left = node->next[0];
right = node->next[1];
kfree(node);
delete_tree(left); /* left child */
delete_tree(right); /* right child */
}
开发者ID:floriade,项目名称:Huffman-Kernel-Module,代码行数:14,代码来源:huffmanmod.c
示例18: analyze_line
Node* analyze_line(String* str)
{
Node* node;
st_token_buf = NULL;
lexer_init(str);
parser_init();
node = parse_acceptable();
switch ( parser_state() ) {
case PS_ACCEPT:
if ( node == NULL ) {
fprintf(stderr, "parse error\n");
}
break;
case PS_ERROR:
parser_print_error();
if ( node != NULL ) {
delete_tree(node);
node = NULL;
}
break;
}
if ( st_token_buf != NULL) {
delete_token(st_token_buf);
st_token_buf = NULL;
}
return node;
}
开发者ID:notozeki,项目名称:mysh,代码行数:31,代码来源:analyzer.c
示例19: main
int main ()
{
short flag = 11; /// flag for menu
leaf *root; /// root of tree
root = new leaf;
root->parent = NULL; /// totaly null root of tree
root->son_l = NULL;
root->son_r = NULL;
root->val = NULL;
while(1)
{
switch (give_mFlag()) /// give flag
{
case 1:
create_tree(root); /// create tree
printf("\n....tree was created");
break;
case 2:
print_tree(root); /// print tree
break;
case 0:
delete_tree(root); /// destroy tree
printf("\n....tree was destroied");
flag = EXIT_WHILE; /// and exit from programm
break;
}
if (flag == EXIT_WHILE) break;
}
getchar();
getchar();
}
开发者ID:KateLiliy,项目名称:Laba4,代码行数:34,代码来源:tree.cpp
示例20: delete_tree
void rt_pvd_file::delete_tree(pwr_tOix oix)
{
m_list[oix].flags |= procom_obj_mFlags_Deleted;
for (pwr_tOix ix = m_list[oix].fchoix; ix; ix = m_list[ix].fwsoix)
delete_tree(ix);
}
开发者ID:siamect,项目名称:proview,代码行数:7,代码来源:rt_pvd_file.cpp
注:本文中的delete_tree函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论