摘要: 6-11 先序输出叶结点(15 分) 本题要求按照先序遍历的顺序输出给定二叉树的叶结点。 函数接口定义: void PreorderPrintLeaves( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef 阅读全文
posted @ 2018-01-31 19:23 我只有一件白T恤 阅读(1365) 评论(0) 推荐(0) 编辑
摘要: 6-10 二分查找(20 分) 本题要求实现二分查找算法。 函数接口定义: Position BinarySearch( List Tbl, ElementType K ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List 阅读全文
posted @ 2018-01-31 16:50 我只有一件白T恤 阅读(524) 评论(0) 推荐(0) 编辑
摘要: 6-9 二叉树的遍历(25 分) 本题要求给定二叉树的4种遍历。 函数接口定义: void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree B 阅读全文
posted @ 2018-01-31 15:52 我只有一件白T恤 阅读(1059) 评论(0) 推荐(0) 编辑
摘要: 6-8 求二叉树高度(20 分) 本题要求给定二叉树的高度。 函数接口定义: int GetHeight( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct 阅读全文
posted @ 2018-01-31 12:22 我只有一件白T恤 阅读(709) 评论(0) 推荐(0) 编辑