当前位置: 首页>>代码示例>>C++>>正文


C++ delete_tree函数代码示例

本文整理汇总了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);
	}
}
开发者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


注:本文中的delete_tree函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。