
数据结构
Kelly Fu
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
栈实现(链式结构)
链式结构 #include <stdio.h> #include <stdlib.h> #include <stdbool.h> typedef int ElemType; typedef enum {overflow, underflow, success, fatal} Status; typedef struct node{ ElemType ele...原创 2018-12-26 14:55:02 · 260 阅读 · 0 评论 -
线性表实现(顺序存储)
线性表结构 typedef int ElemType; #define LIST_INIT_SIZE 100 #define LIST_INCREAMENT 10 //定义一个Bool类型 typedef int Bool; #define TRUE 1 #define FASLE 0 // 操作线性表返回状态 typedef enum{ success = 0, fail, ra...原创 2018-12-21 17:07:24 · 188 阅读 · 0 评论 -
队列实现(顺序结构)
顺序结构结构 #include <stdio.h> #include <stdlib.h> #define QUEUE_SIZE 10 typedef int ElemType; typedef enum {overflow,underflow,success,fatal}Status; typedef struct queue{ ElemType *ele; ...原创 2018-12-27 15:50:11 · 324 阅读 · 0 评论 -
队列实现(顺序结构2-循环队列)
循环队列 问题解决 如何解决浪费的问题、假溢出问题, 循环队列来解决.循环队列来解决. 循环队列空和满的判断解决: 使用一个计数器count, 初始化为0, 入队列加一, 出队列减一 ,当count == QUEUE_SIZE, 则判断队列满 利用一个flag标记, true代表入队列, false代表出队列, 初始化为false. 当head == tail, 如果flag为tr...原创 2018-12-27 16:15:35 · 240 阅读 · 0 评论 -
队列实现(链表)
链式结构 #include <stdio.h> #include <stdlib.h> typedef int ElemType; typedef enum {underflow, success, fatal} Status; typedef struct node{ ElemType ele; struct node * next; }Node,*Node...原创 2018-12-27 17:55:20 · 144 阅读 · 0 评论 -
线性表实现(链表)
链表结构 typedef int ElemType; typedef int Bool; #define True 1 #define False 0 typedef enum{ success = 0, fail, range_error, fatal }Status; typedef struct Node{ ElemType data; struct Node...原创 2018-12-24 14:20:31 · 126 阅读 · 0 评论 -
栈实现(顺序结构)
顺序结构 #include &amp;lt;stdio.h&amp;gt; #include &amp;lt;stdlib.h&amp;gt; #include &amp;lt;stdbool.h&amp;gt; #define STACK_SIZE 100 typedef int ElemType; typedef enum { overflow, underflow, success, fatal}S原创 2018-12-26 12:23:14 · 268 阅读 · 0 评论 -
二叉树(性质、存储、遍历、建立)
二叉树性质 二叉树第i层叶子数最多为2i−12^{i-1}2i−1 深度为i的二叉树的节点数最多为 2i−12^{i}-12i−1 在二叉树中, 叶子数为n0n_{0}n0, 度为2的节点数为n2n_{2}n2, 则满足 :n0=n2+1n_{0} = n_{2}+1n0=n2+1 证明: n0+n1+n2=n0∗0+n1∗1+n2∗2+1n_{0} + n_{1} + n_{2} =...原创 2019-01-09 18:01:27 · 312 阅读 · 0 评论