上一页 1 2 3 4 5 6 7 8 ··· 10 下一页
摘要: 堆栈的定义与操作-顺序存储typedef int Position;struct SNode { ElementType *Data; /* 存储元素的数组 */ Position Top; /* 栈顶指针 */ int MaxSize; ... 阅读全文
posted @ 2018-05-09 15:24 focus5679 阅读(481) 评论(0) 推荐(0) 编辑
摘要: 线性表的定义与操作-顺序表typedef int Position;typedef struct LNode *List;struct LNode { ElementType Data[MAXSIZE]; Position Last;}; /* 初始化 *... 阅读全文
posted @ 2018-05-09 15:21 focus5679 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 04-树7 二叉搜索树的操作集(30 分)本题要求实现给定二叉搜索树的5种常用操作。函数接口定义:BinTree Insert( BinTree BST, ElementType X );BinTree Delete( BinTree BST, ElementType... 阅读全文
posted @ 2018-05-07 21:21 focus5679 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 04-树4 是否同一棵二叉搜索树(25 分)给定一个插入序列就可以唯一确定一棵二叉搜索树。然而,一棵给定的二叉搜索树却可以由多种不同的插入序列得到。例如分别按照序列{2, 1, 3}和{2, 3, 1}插入初始为空的二叉搜索树,都得到一样的结果。于是对于输入的各种插入... 阅读全文
posted @ 2018-05-07 14:52 focus5679 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 03-树3 Tree Traversals Again(25 分)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example,... 阅读全文
posted @ 2018-05-04 14:02 focus5679 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 头文件#define _CRT_SBCURE_NO_DEPRECATE#include #include #include #include #include #include #include #include #include #include #include ... 阅读全文
posted @ 2018-05-03 15:07 focus5679 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 03-树2 List Leaves(25 分)Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specifi... 阅读全文
posted @ 2018-05-01 21:54 focus5679 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 03-树1 树的同构(25 分)给定两棵树T1和T2。如果T1可以通过若干次左右孩子互换就变成T2,则我们称两棵树是“同构”的。例如图1给出的两棵树就是同构的,因为我们把其中一棵树的结点A、B、G的左右孩子互换后,就得到另外一棵树。而图2就不是同构的。图1图2现给定两... 阅读全文
posted @ 2018-05-01 19:47 focus5679 阅读(146) 评论(0) 推荐(0) 编辑
摘要: 02-线性结构4 Pop Sequence(25 分)Given a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop rand... 阅读全文
posted @ 2018-05-01 14:43 focus5679 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 02-线性结构1 两个有序链表序列的合并(15 分)本题要求实现一个函数,将两个链表表示的递增整数序列合并为一个非递减的整数序列。函数接口定义:List Merge( List L1, List L2 );其中List结构定义如下:typedef struct Nod... 阅读全文
posted @ 2018-05-01 13:32 focus5679 阅读(168) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 10 下一页