PTA
文章平均质量分 86
呆橘丶
这个作者很懒,什么都没留下…
展开
-
PTA:6-1 二叉树的遍历
本题要求给定二叉树的4种遍历。 函数接口定义: void InorderTraversal( BinTree BT ); void PreorderTraversal( BinTree BT ); void PostorderTraversal( BinTree BT ); void LevelorderTraversal( BinTree BT ); 其中BinTree结构定义如下: ty...转载 2019-05-06 22:08:41 · 4498 阅读 · 3 评论 -
6-2 求二叉树高度
函数接口定义: int GetHeight( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct TNode{ ElementType Data; BinTree Left; BinTree Right; }; 要...转载 2019-05-06 22:14:17 · 921 阅读 · 0 评论 -
6-3 先序输出叶结点
本题要求按照先序遍历的顺序输出给定二叉树的叶结点。 函数接口定义: void PreorderPrintLeaves( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct TNode{ ElementType Data; BinTree Le...转载 2019-05-06 22:13:04 · 786 阅读 · 0 评论 -
7-1 修理牧场
7-1 修理牧场 #include<stdio.h> #include<stdlib.h> struct HNode{ int * data; int maxsize; int size; }; typedef HNode* MinTree; /*创建一个空的最小堆*/ MinTree Creat(int max){ MinTree H = (MinTree...原创 2019-05-22 11:32:52 · 606 阅读 · 0 评论