大话数据结构
小麦大大
写写代码纪录生活
展开
-
大话数据结构之线性表
//01线性表顺序存储_List #include "pch.h"//(这个文件是VS2017需要加上的,大家用其他编译器,记得删除掉) #include <stdio.h> #include <stdlib.h> #include "io.h" #include "math.h" #include "time.h" #define OK 1 #define E...原创 2019-04-29 16:23:35 · 150 阅读 · 0 评论 -
大话数据结构之树
树 看了一下大话数据结构的树源码对应基础差的东西还是不太友好,这边写了一篇简单的。(个人观点) 例如:上面这一棵树写个简单关于树的代码实际树的运用还是围绕二叉树和红黑树展开: #include "pch.h" #include <stdio.h> #include <stdlib.h> struct node { int data; struct node*lch...原创 2019-04-30 15:00:37 · 213 阅读 · 1 评论 -
大话数据结构之队列
插入操作 大家简单看一下,后面在详细说明 删除操作: //06链队列_LinkQueue #include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK 1 #define ERROR 0 #define TRUE 1 #d...原创 2019-04-30 14:44:00 · 110 阅读 · 0 评论 -
大话数据结构之顺序队列
//05顺序队列_Queue #include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #define MAXSIZE 20 /* ...原创 2019-04-30 14:12:33 · 142 阅读 · 0 评论 -
大话数据结构之斐波那契数列
//04斐波那契函数_Fibonacci #include "stdio.h" int Fbi(int i) /* 斐波那契的递归函数 */ { if (i < 2) return i == 0 ? 0 : 1; return Fbi(i - 1) + Fbi(i - 2); /* 这里Fbi就是函数自己,等于在调用自己 */ } //0 1 1 2 3 int main()...原创 2019-04-29 19:02:26 · 215 阅读 · 0 评论 -
大话数据结构之链栈
进栈操作 出栈操作 //03链栈_LinkStack #include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #define ...原创 2019-04-29 18:02:42 · 182 阅读 · 0 评论 -
大话西游之两栈共享空间(了解就行比较独特)
//02两栈共享空间_DoubleStack #include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #define MAXSIZ...原创 2019-04-29 17:19:10 · 128 阅读 · 0 评论 -
大话西游之顺序栈
//01顺序栈_Stack #include "pch.h" #include "stdio.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK 1 #define ERROR 0 #define TRUE 1 #define FALSE 0 #defi...原创 2019-04-29 16:49:53 · 293 阅读 · 0 评论 -
大话数据结构之链表
#include "pch.h"//(这个是VS2017需要加上的,大家记得去掉) #include "stdio.h" #include "string.h" #include "ctype.h" #include "stdlib.h" #include "io.h" #include "math.h" #include "time.h" #define OK...原创 2019-04-29 16:26:25 · 245 阅读 · 5 评论 -
大话数据结构之二叉树
上一遍写了一个简单的树,没有给大家介绍树的概念,对应初学者可能不是很容易看懂,等一下在这一篇介绍树的概念和自己看完大话数据结构写的一篇容易理解的二叉树。 1. 树的定义 树是一种数据结构,它是由n(n>=1)个有限节点组成一个具有层次关系的集合。 把它叫做“树”是因为它看起来像一棵倒挂的树,也就是说它是根朝上,而叶朝下的。它具有以下的特点: (01) 每个节点有零个或多个子节点; (02)...原创 2019-04-30 15:38:13 · 293 阅读 · 0 评论