摘要:
本题要求实现给定二叉搜索树的5种常用操作。 函数接口定义: BinTree Insert( BinTree BST, ElementType X ); BinTree Delete( BinTree BST, ElementType X ); Position Find( BinTree BST, 阅读全文
摘要:
题目链接:https://pintia.cn/problem-sets/15/problems/925 代码: void PreorderPrintLeaves( BinTree BT ){ if(BT==NULL){ return; } if(BT->Left!=NULL){ PreorderPr 阅读全文
摘要:
本题要求实现二分查找算法。 函数接口定义: Position BinarySearch( List L, ElementType X ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List; struct LNode { E 阅读全文
摘要:
本题要求给定二叉树的4种遍历。 函数接口定义: void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree BT ); void Levelor 阅读全文
摘要:
本题要求给定二叉树的高度。 函数接口定义: int GetHeight( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct TNode{ ElementTyp 阅读全文