摘要: 本题要求实现二分查找算法。 函数接口定义: 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) 编辑
摘要: 本题要求在一个数组中实现两个堆栈。 函数接口定义: Stack CreateStack( int MaxSize );bool Push( Stack S, ElementType X, int Tag );ElementType Pop( Stack S, int Tag ); 其中Tag是堆栈编 阅读全文
posted @ 2022-07-18 17:08 Yohoc 阅读(46) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现带头结点的链式表操作集。 函数接口定义: List MakeEmpty(); Position Find( List L, ElementType X ); bool Insert( List L, ElementType X, Position P ); bool Delete( Li 阅读全文
posted @ 2022-07-15 09:41 Yohoc 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现链式表的操作集。 函数接口定义: Position Find( List L, ElementType X ); List Insert( List L, ElementType X, Position P ); List Delete( List L, Position P ); 其中 阅读全文
posted @ 2022-07-14 14:27 Yohoc 阅读(69) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现一个函数,找到并返回链式表的第K个元素。 函数接口定义: ElementType FindKth( List L, int K ); 其中List结构定义如下: typedef struct LNode *PtrToLNode; struct LNode { ElementType Da 阅读全文
posted @ 2022-07-13 09:34 Yohoc 阅读(79) 评论(0) 推荐(0) 编辑
摘要: 本题要求实现一个函数,求链式表的表长。 函数接口定义: int Length( List L ); 其中List结构定义如下: typedef struct LNode *PtrToLNode; struct LNode { ElementType Data; PtrToLNode Next; }; 阅读全文
posted @ 2022-07-13 09:02 Yohoc 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 6-2 顺序表操作集 本题要求实现顺序表的操作集 函数接口定义: List MakeEmpty(); Position Find( List L, ElementType X ); bool Insert( List L, ElementType X, Position P ); bool Dele 阅读全文
posted @ 2022-07-11 14:18 Yohoc 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 6-1 单链表逆转 本题要求实现一个函数,将给定的单链表逆转。 函数接口定义: List Reverse( List L ); 其中List结构定义如下: typedef struct Node *PtrToNode; struct Node { ElementType Data; /* 存储结点数 阅读全文
posted @ 2022-07-11 10:58 Yohoc 阅读(146) 评论(0) 推荐(0) 编辑