您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ DestroyTree函数代码示例

51自学网 2021-06-01 20:27:16
  C++
这篇教程C++ DestroyTree函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中DestroyTree函数的典型用法代码示例。如果您正苦于以下问题:C++ DestroyTree函数的具体用法?C++ DestroyTree怎么用?C++ DestroyTree使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了DestroyTree函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Test2

// There are branches in trees, and tree B is not a subtree of tree A//                  8                8//              /       /           / ///             8         7         9   2//           /   ///          9     3//               / ///              4   7void Test2(){    BinaryTreeNode* pNodeA1 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeA2 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeA3 = CreateBinaryTreeNode(7);    BinaryTreeNode* pNodeA4 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNodeA5 = CreateBinaryTreeNode(3);    BinaryTreeNode* pNodeA6 = CreateBinaryTreeNode(4);    BinaryTreeNode* pNodeA7 = CreateBinaryTreeNode(7);    ConnectTreeNodes(pNodeA1, pNodeA2, pNodeA3);    ConnectTreeNodes(pNodeA2, pNodeA4, pNodeA5);    ConnectTreeNodes(pNodeA5, pNodeA6, pNodeA7);    BinaryTreeNode* pNodeB1 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeB2 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNodeB3 = CreateBinaryTreeNode(2);    ConnectTreeNodes(pNodeB1, pNodeB2, pNodeB3);    Test("Test2", pNodeA1, pNodeB1, false);    DestroyTree(pNodeA1);    DestroyTree(pNodeB1);}
开发者ID:brian-smith723,项目名称:DesignPatterns,代码行数:33,


示例2: main

int main(void) {	unsigned char pkt[200];	req r;	ssize_t len;	unsigned int i;	FILE *in;	uint32_t seed;	signal(SIGALRM, tooslow);	alarm(TIMEOUT);	// set up the head of the SNMP MIB tree	InitTree();	SetCount = 0;	ErrCount = 0;	// seed the prng	if ((in = fopen("/dev/urandom", "r")) == NULL) {		exit(-1);	}	if (fread(&seed, 1, 4, in) != 4) {		exit(-1);	}	fclose(in);	srand(seed);	// init the MIB with some objects	PopulateMIB();	while (1) {		if (ErrCount > MAX_ERRORS) {			DestroyTree(MIB);			exit(-1);		}		bzero(pkt, 200);		bzero(&r, sizeof(req));		if ((len = ReceivePacket(pkt, 200)) == 0) {			DestroyTree(MIB);			exit(-1);		}		// reset the timer		alarm(TIMEOUT);				// parse the packet and handle the particular request		if (ParseSnmpPkt(pkt, len, &r)) {			if (r.type == GET_REQUEST) {				HandleGetRequest(&r);			} else if (r.type == GET_NEXT_REQUEST) {				HandleGetNextRequest(&r);			} else if (r.type == SET_REQUEST) {				HandleSetRequest(&r);			}		} else {			// error parsing packet			ErrCount++;		}	}}
开发者ID:legitbs,项目名称:quals-2015,代码行数:60,


示例3: Test6

// Nodes in tree A only have right children, and tree B is not a subtree of tree A//       8                   8//        /                   / //         8                   9   //          /                 / ///           9               3   2//            /      //             2        //              ///               5void Test6(){    BinaryTreeNode* pNodeA1 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeA2 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeA3 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNodeA4 = CreateBinaryTreeNode(2);    BinaryTreeNode* pNodeA5 = CreateBinaryTreeNode(5);    ConnectTreeNodes(pNodeA1, NULL, pNodeA2);    ConnectTreeNodes(pNodeA2, NULL, pNodeA3);    ConnectTreeNodes(pNodeA3, NULL, pNodeA4);    ConnectTreeNodes(pNodeA4, NULL, pNodeA5);    BinaryTreeNode* pNodeB1 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeB2 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNodeB3 = CreateBinaryTreeNode(3);    BinaryTreeNode* pNodeB4 = CreateBinaryTreeNode(2);    ConnectTreeNodes(pNodeB1, NULL, pNodeB2);    ConnectTreeNodes(pNodeB2, pNodeB3, pNodeB4);    Test("Test6", pNodeA1, pNodeB1, false);    DestroyTree(pNodeA1);    DestroyTree(pNodeB1);}
开发者ID:brian-smith723,项目名称:DesignPatterns,代码行数:36,


示例4: DeleteChild

Status DeleteChild(CSTree &T, CSTree p, int i){	CSTree b, q;	int j;	if (T) {		if (i == 1) {			b = p->firstchild;			p->firstchild = b->nextsibling;			b->nextsibling = NULL;			DestroyTree(b);		} else { q = p->firstchild;			 j = 2;			 while (q && j < i) {				 q = q->nextsibling;				 j++;			 }			 if (j == i) {				 b = q->nextsibling;				 q->nextsibling = b->nextsibling;				 b->nextsibling = NULL;				 DestroyTree(b);			 } else {				 return ERROR;			 } }		return OK;	} else {		return ERROR;	}}
开发者ID:zqw86713,项目名称:Data.Structure.Solution,代码行数:30,


示例5: Test3

// Nodes in trees only have left children, and tree B is a subtree of tree A//                8                  8//              /                   / //             8                   9   //           /                    ///          9                    2//         /      //        2        //       ///      5void Test3(){    BinaryTreeNode* pNodeA1 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeA2 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeA3 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNodeA4 = CreateBinaryTreeNode(2);    BinaryTreeNode* pNodeA5 = CreateBinaryTreeNode(5);    ConnectTreeNodes(pNodeA1, pNodeA2, NULL);    ConnectTreeNodes(pNodeA2, pNodeA3, NULL);    ConnectTreeNodes(pNodeA3, pNodeA4, NULL);    ConnectTreeNodes(pNodeA4, pNodeA5, NULL);    BinaryTreeNode* pNodeB1 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNodeB2 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNodeB3 = CreateBinaryTreeNode(2);    ConnectTreeNodes(pNodeB1, pNodeB2, NULL);    ConnectTreeNodes(pNodeB2, pNodeB3, NULL);    Test("Test3", pNodeA1, pNodeB1, true);    DestroyTree(pNodeA1);    DestroyTree(pNodeB1);}
开发者ID:brian-smith723,项目名称:DesignPatterns,代码行数:35,


示例6: DestroyTree

/** * 删除一棵树,并释放相应的结点空间 * 注意,不要忘了加&,否则T无法释放 */void DestroyTree(BiTree &T){	if (T) {		DestroyTree(T->lchild);	//先删除左右子树		DestroyTree(T->rchild);		free(T);		T = NULL;	}}
开发者ID:Annie2333,项目名称:DS_Code,代码行数:13,


示例7: DestroyTree

void DestroyTree(CSTree &T){	if (T) {		DestroyTree(T->firstchild);		DestroyTree(T->nextsibling);		free(T);		T = NULL;	}}
开发者ID:zqw86713,项目名称:Data.Structure.Solution,代码行数:9,


示例8: DestroyTree

void BinaryTree::DestroyTree ( node* leaf ){	if ( leaf != NULL )	{		DestroyTree ( leaf->left );		DestroyTree ( leaf->right );		delete leaf;	}}
开发者ID:MiloshHasCamo,项目名称:Motor,代码行数:9,


示例9: DestroyTree

static voidDestroyTree( BinTree T ){    if( T != NULL )    {        DestroyTree( T->LeftChild );        DestroyTree( T->NextSibling );        free( T );    }}
开发者ID:adofsauron,项目名称:vsproj,代码行数:10,


示例10: DestroyTree

/* This frees the memory for a binary tree of type LEAF* using recursion   the parameter is the head of the tree. */void DestroyTree(LEAF* head) {   if (head == NULL) {      return;   }   else {      DestroyTree(head->lchild);      DestroyTree(head->rchild);      free(head);   }}
开发者ID:LukeWalsh,项目名称:ipa2_1,代码行数:13,


示例11: DestroyTree

void DestroyTree(BSTreeNode* root){	if(root)	{		DestroyTree(root->m_pLeft);		DestroyTree(root->m_pRight);		delete root;		root = 0;	}}
开发者ID:MarsZhuJin,项目名称:microsoft-interview-100,代码行数:10,


示例12: DestroyTree

void BinarySearchTree::DestroyTree( Node *node ){	if ( node != nullptr )	{		DestroyTree( node->left );		DestroyTree( node->right );		delete node;		node = nullptr;	}}
开发者ID:zrma,项目名称:AlgorithmAdvanced,代码行数:11,


示例13: DestroyTree

// Release the resourcesvoid BinaryTreeMethod::DestroyTree(TreeNode **p_Root){	if(!p_Root || !(*p_Root))	{		return;	}	DestroyTree(&((*p_Root)->p_left));	DestroyTree(&((*p_Root)->p_right));	delete *p_Root;	p_Root = 0;}
开发者ID:jiabailie,项目名称:Algorithm,代码行数:12,


示例14: DestroyTree

 void DestroyTree(CSTree *T) { /* 初始条件: 树T存在。操作结果: 销毁树T */   if(*T)   {     if((*T)->firstchild) /* T有长子 */       DestroyTree(&(*T)->firstchild); /* 销毁T的长子为根结点的子树 */     if((*T)->nextsibling) /* T有下一个兄弟 */       DestroyTree(&(*T)->nextsibling); /* 销毁T的下一个兄弟为根结点的子树 */     free(*T); /* 释放根结点 */     *T=NULL;   } }
开发者ID:githubzenganiu,项目名称:toekn,代码行数:12,


示例15: DestroyTree

 static void DestroyTree(CSTree &T) { // 初始条件: 树T存在。操作结果: 销毁树T   if(T)   {     if(T->firstchild) // T有长子       DestroyTree(T->firstchild); // 销毁T的长子为根结点的子树     if(T->nextsibling) // T有下一个兄弟       DestroyTree(T->nextsibling); // 销毁T的下一个兄弟为根结点的子树     free(T); // 释放根结点     T=NULL;   } }
开发者ID:cjpthree,项目名称:datastructure_vs,代码行数:12,


示例16: DestroyTree

void DestroyTree(BinaryTreeNode* pRoot) {		if(pRoot != NULL) {		BinaryTreeNode* pLeft = pRoot->m_pLeft;		BinaryTreeNode* pRight = pRoot->m_pRight;		delete pRoot;		pRoot = NULL;		DestroyTree(pLeft);		DestroyTree(pRight);	}}
开发者ID:irwenqiang,项目名称:inverview-algo,代码行数:13,


示例17: DestroyTree

void DestroyTree(BNode** tree){    if (!tree || !*tree)    {        return;    }    BNode* pTree = *tree;    DestroyTree(&(pTree->left));    DestroyTree(&(pTree->right));    delete pTree;    *tree = nullptr;}
开发者ID:seanhaneberg,项目名称:breadthLink,代码行数:15,


示例18: TestDestroyTree

BOOL TestDestroyTree(){    PTreeNode pTreeHead = NULL;    PTreeNode  pNode = NULL ;    PTreeNode  pChild = NULL ;    int sum = 0 ;    int j = 0 ;    pTreeHead = new TreeNode ;    NULLVALUE_CHECK(pTreeHead, TestDestroyTree) ;    //InitTreeNode(pTreeHead) ;    // 添加树节点    int i = 0 ;    for (; i < 3; ++i)    {        pNode = new TreeNode ;        //InitTreeNode(pNode) ;        pNode->dwAddress = sum++ ;                pTreeHead->list.push_back(pNode) ;        pChild = new TreeNode ;        //InitTreeNode(pChild) ;        pChild->dwAddress = sum++ ;        pNode->list.push_back(pChild) ;    }    DestroyTree(pTreeHead) ;    OutputDebugString(_T("TestDestroyTree pass !/r/n")) ;    return TRUE ;}
开发者ID:EvilKnight1986,项目名称:RunTracing,代码行数:33,


示例19: DestroyTopology

bool ON_Mesh::DeleteFace( int meshfi ){  // Do NOT add a call Compact() in this function.  // Compact() is slow and this function may be called  // many times in sequence.    // It is the callers responsibility to call Compact()  // when it is needed.  bool rc = false;  if ( meshfi >= 0 && meshfi < m_F.Count() )  {    if ( m_top.m_topf.Count() > 0 )    {      DestroyTopology();    }    DestroyPartition();    DestroyTree();    if ( m_FN.Count() == m_F.Count() )    {      m_FN.Remove(meshfi);    }    m_F.Remove(meshfi);    // 6 Mar 2010 S. Baer    // Invalidate the cached IsClosed flag. This forces the mesh to    // recompute IsClosed the next time it is called    SetClosed(-1);    rc = true;  }  return rc;}
开发者ID:2php,项目名称:pcl,代码行数:32,


示例20: main

int main(int argc, char *argv[]) {	if (CheckArgCount(argc) == 0) {		return EXIT_FAILURE;	}	/* Open the input file */	FILE* fptr = NULL;	if ((fptr = OpenFile(argv[1], "rb")) == NULL) {		return EXIT_FAILURE;	}   /* Generate the huffman tree from the header of the file */	LEAF* head = NULL;	int charactersInData;	if ((head = GenerateTree(fptr, &charactersInData)) == NULL) {	/* After this call fptr is pointing to the data */		return EXIT_FAILURE;	}	/* Open the output file */	FILE* outfptr = NULL;	if ((outfptr = OpenFile(argv[2], "w+")) == NULL) {		return EXIT_FAILURE;	}	/* Print the data to the output file */	DecodeUsingTree(fptr, outfptr, head, charactersInData);	/* When we make this call fptr is pointing directly to the data */		fclose(fptr);	fclose(outfptr);// 	PostOrderWalk(head);	DestroyTree(head);	return EXIT_SUCCESS;}
开发者ID:LukeWalsh,项目名称:ipa2_3,代码行数:29,


示例21: Test1

// ====================测试代码====================//            8//        6      10//       5 7    9  11void Test1(){    BinaryTreeNode* pNode8 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNode6 = CreateBinaryTreeNode(6);    BinaryTreeNode* pNode10 = CreateBinaryTreeNode(10);    BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);    BinaryTreeNode* pNode7 = CreateBinaryTreeNode(7);    BinaryTreeNode* pNode9 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNode11 = CreateBinaryTreeNode(11);    ConnectTreeNodes(pNode8, pNode6, pNode10);    ConnectTreeNodes(pNode6, pNode5, pNode7);    ConnectTreeNodes(pNode10, pNode9, pNode11);    printf("====Test1 Begins: ====/n");    printf("Expected Result is:/n");    printf("8 /n");    printf("10 6 /n");    printf("5 7 9 11 /n/n");    printf("Actual Result is: /n");    Print(pNode8);    printf("/n");    DestroyTree(pNode8);}
开发者ID:KingWangSeet,项目名称:CodingInterviewChinese2,代码行数:30,


示例22: Test4

// There is only one node in a treevoid Test4(){    BinaryTreeNode* pNode1 = CreateBinaryTreeNode(1);    Test("Test4", pNode1);    DestroyTree(pNode1);}
开发者ID:brian-smith723,项目名称:DesignPatterns,代码行数:8,


示例23: TestB

//               5//              ///             4//            ///           3//          ///         2//        ///       1void TestB(){    BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);    BinaryTreeNode* pNode4 = CreateBinaryTreeNode(4);    BinaryTreeNode* pNode3 = CreateBinaryTreeNode(3);    BinaryTreeNode* pNode2 = CreateBinaryTreeNode(2);    BinaryTreeNode* pNode1 = CreateBinaryTreeNode(1);    ConnectTreeNodes(pNode5, pNode4, nullptr);    ConnectTreeNodes(pNode4, pNode3, nullptr);    ConnectTreeNodes(pNode3, pNode2, nullptr);    ConnectTreeNodes(pNode2, pNode1, nullptr);    Test("TestB0", pNode5, 0, true, -1);    Test("TestB1", pNode5, 1, false, 1);    Test("TestB2", pNode5, 2, false, 2);    Test("TestB3", pNode5, 3, false, 3);    Test("TestB4", pNode5, 4, false, 4);    Test("TestB5", pNode5, 5, false, 5);    Test("TestB6", pNode5, 6, true, -1);    DestroyTree(pNode5);    printf("/n/n");}
开发者ID:PengJi,项目名称:vc6_practice,代码行数:34,


示例24: TestA

//            8//        6      10//       5 7    9  11void TestA(){    BinaryTreeNode* pNode8 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNode6 = CreateBinaryTreeNode(6);    BinaryTreeNode* pNode10 = CreateBinaryTreeNode(10);    BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);    BinaryTreeNode* pNode7 = CreateBinaryTreeNode(7);    BinaryTreeNode* pNode9 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNode11 = CreateBinaryTreeNode(11);    ConnectTreeNodes(pNode8, pNode6, pNode10);    ConnectTreeNodes(pNode6, pNode5, pNode7);    ConnectTreeNodes(pNode10, pNode9, pNode11);    Test("TestA0", pNode8, 0, true, -1);    Test("TestA1", pNode8, 1, false, 5);    Test("TestA2", pNode8, 2, false, 6);    Test("TestA3", pNode8, 3, false, 7);    Test("TestA4", pNode8, 4, false, 8);    Test("TestA5", pNode8, 5, false, 9);    Test("TestA6", pNode8, 6, false, 10);    Test("TestA7", pNode8, 7, false, 11);    Test("TestA8", pNode8, 8, true, -1);    DestroyTree(pNode8);    printf("/n/n");}
开发者ID:PengJi,项目名称:vc6_practice,代码行数:31,


示例25: Test6

// 树中只有1个结点void Test6(){    BinaryTreeNode* pNode1 = CreateBinaryTreeNode(1);    Test("Test6", pNode1, true);    DestroyTree(pNode1);}
开发者ID:2015winter,项目名称:interview,代码行数:8,


示例26: Test1

// ====================测试代码====================// 测试完全二叉树:除了叶子节点,其他节点都有两个子节点//            8//        6      10//       5 7    9  11void Test1(){    printf("=====Test1 starts:=====/n");    BinaryTreeNode* pNode8 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNode6 = CreateBinaryTreeNode(6);    BinaryTreeNode* pNode10 = CreateBinaryTreeNode(10);    BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);    BinaryTreeNode* pNode7 = CreateBinaryTreeNode(7);    BinaryTreeNode* pNode9 = CreateBinaryTreeNode(9);    BinaryTreeNode* pNode11 = CreateBinaryTreeNode(11);    ConnectTreeNodes(pNode8, pNode6, pNode10);    ConnectTreeNodes(pNode6, pNode5, pNode7);    ConnectTreeNodes(pNode10, pNode9, pNode11);    PrintTree(pNode8);    printf("=====Test1: MirrorRecursively=====/n");    MirrorRecursively(pNode8);    PrintTree(pNode8);    printf("=====Test1: MirrorIteratively=====/n");    MirrorIteratively(pNode8);    PrintTree(pNode8);    DestroyTree(pNode8);}
开发者ID:2015winter,项目名称:interview,代码行数:32,


示例27: ApplyOriginalPoseToScene

// ----------------------------------------------------------------------------void IKSolver::SetAlgorithm(IKSolver::Algorithm algorithm){    algorithm_ = algorithm;    /* We need to rebuild the tree so make sure that the scene is in the     * initial pose when this occurs.*/    if (node_ != nullptr)        ApplyOriginalPoseToScene();    // Initial flags for when there is no solver to destroy    uint8_t initialFlags = 0;    // Destroys the tree and the solver    if (solver_ != nullptr)    {        initialFlags = solver_->flags;        DestroyTree();        ik_solver_destroy(solver_);    }    switch (algorithm_)    {        case ONE_BONE : solver_ = ik_solver_create(SOLVER_ONE_BONE); break;        case TWO_BONE : solver_ = ik_solver_create(SOLVER_TWO_BONE); break;        case FABRIK   : solver_ = ik_solver_create(SOLVER_FABRIK);   break;        /*case MSD      : solver_ = ik_solver_create(SOLVER_MSD);      break;*/    }    solver_->flags = initialFlags;    if (node_ != nullptr)        RebuildTree();}
开发者ID:nemerle,项目名称:lutefisk3d,代码行数:34,


示例28: Test2

// 测试二叉树:出叶子结点之外,左右的结点都有且只有一个左子结点//            8//          7   //        6 //      5//    4void Test2(){    printf("=====Test2 starts:=====/n");    BinaryTreeNode* pNode8 = CreateBinaryTreeNode(8);    BinaryTreeNode* pNode7 = CreateBinaryTreeNode(7);    BinaryTreeNode* pNode6 = CreateBinaryTreeNode(6);    BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);    BinaryTreeNode* pNode4 = CreateBinaryTreeNode(4);    ConnectTreeNodes(pNode8, pNode7, NULL);    ConnectTreeNodes(pNode7, pNode6, NULL);    ConnectTreeNodes(pNode6, pNode5, NULL);    ConnectTreeNodes(pNode5, pNode4, NULL);    PrintTree(pNode8);    printf("=====Test2: MirrorRecursively=====/n");    MirrorRecursively(pNode8);    PrintTree(pNode8);    printf("=====Test2: MirrorIteratively=====/n");    MirrorIteratively(pNode8);    PrintTree(pNode8);    DestroyTree(pNode8);}
开发者ID:2015winter,项目名称:interview,代码行数:32,


示例29: main

int main(int argc, char **argv){	CSTree T;	TElemType e;	TElemType e1;	InitTree(&T);	printf("构造空树后,树空否? %d(1:是 0:否) 树根为%c 树的深度为%d/n",/			TreeEmpty(T), Root(T), TreeDepth(T));	CreateTree(&T);	printf("构造空树后,树空否? %d(1:是 0:否) 树根为%c 树的深度为%d/n",/				TreeEmpty(T), Root(T), TreeDepth(T));	printf("先根遍历树T:/n");	PreOrderTraverse(T, vi);	printf("/n请输入等修改的结点的值 新值:");	scanf("%c%*c%c%*c", &e, &e1);	Assign(&T, e, e1);	printf("后根遍历修改后的树T:/n");	PostOrderTraverse_recurssion1(T, vi);	printf("/n");	printf("PostOrderTraverse_recurssion1 complete!/n");	PostOrderTraverse_recurssion2(T, vi);	printf("/n");	printf("PostOrderTraverse_recurssion2 complete!/n");	printf("/n%c的双亲是%c, 长子是%c,下一个兄弟是%c/n", e1, Parent(T, e1),/			LeftChild(T, e1), RightSibling(T, e1));	printf("层序遍历树:/n");	LevelOrderTraverse(T, vi);	DestroyTree(&T);	return EXIT_SUCCESS;}
开发者ID:jasonleakey,项目名称:CrapCodes,代码行数:30,


示例30: TestC

// 1//  ///   2//    ///     3//      ///       4//        ///         5void TestC(){    BinaryTreeNode* pNode1 = CreateBinaryTreeNode(1);    BinaryTreeNode* pNode2 = CreateBinaryTreeNode(2);    BinaryTreeNode* pNode3 = CreateBinaryTreeNode(3);    BinaryTreeNode* pNode4 = CreateBinaryTreeNode(4);    BinaryTreeNode* pNode5 = CreateBinaryTreeNode(5);    ConnectTreeNodes(pNode1, nullptr, pNode2);    ConnectTreeNodes(pNode2, nullptr, pNode3);    ConnectTreeNodes(pNode3, nullptr, pNode4);    ConnectTreeNodes(pNode4, nullptr, pNode5);    Test("TestC0", pNode1, 0, true, -1);    Test("TestC1", pNode1, 1, false, 1);    Test("TestC2", pNode1, 2, false, 2);    Test("TestC3", pNode1, 3, false, 3);    Test("TestC4", pNode1, 4, false, 4);    Test("TestC5", pNode1, 5, false, 5);    Test("TestC6", pNode1, 6, true, -1);    DestroyTree(pNode1);    printf("/n/n");}
开发者ID:PengJi,项目名称:vc6_practice,代码行数:34,



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


C++ DestroyWindow函数代码示例
C++ DestroyString函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。