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