![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构习题
文章平均质量分 57
Jojozzc
这个作者很懒,什么都没留下…
展开
-
4-7 在一个数组中实现两个堆栈 (20分)
#include #include #define ERROR 1e8 typedef int ElementType; typedef enum { push, pop, end } Operation; typedef enum { false, true } bool; typedef int Position; struct SNode { ElementType *Data;原创 2016-08-18 10:19:33 · 1254 阅读 · 0 评论 -
数据结构与算法题目集(中文)4-9 二叉树的遍历 (25分)
void InorderTraversal(BinTree BT) { if (BT) { InorderTraversal(BT->Left); printf(" %c", BT->Data); InorderTraversal(BT->Right); } } void PreorderTraversal(BinTree BT) { if (BT) { printf("原创 2016-08-18 14:52:54 · 645 阅读 · 0 评论 -
数据结构与算法题目集(中文)4-10 二分查找 (20分)
4-10 二分查找 (20分) 本题要求实现二分查找算法。 函数接口定义: Position BinarySearch( List Tbl, ElementType K ); 其中List结构定义如下: typedef int Position; typedef struct LNode *List; struct LNode { ElementType D原创 2016-08-18 15:10:48 · 6844 阅读 · 0 评论 -
数据结构与算法题目集(中文)4-11 先序输出叶结点 (15分)
4-11 先序输出叶结点 (15分) 本题要求按照先序遍历的顺序输出给定二叉树的叶结点。 函数接口定义: void PreorderPrintLeaves( BinTree BT ); 其中BinTree结构定义如下: typedef struct TNode *Position; typedef Position BinTree; struct TNode{原创 2016-08-18 15:19:16 · 8316 阅读 · 0 评论