11 2019 档案

摘要:一、图的存储结构 1.邻接矩阵 一维数组存储顶点,二维数组存储边 (1)无向图: (2)有向图: 图的存储结构代码实现: 1 #define MaxSize 10 //假设图中最多顶点个数 2 typedef char DataType; //图中顶点的数据类型,假设为char型 3 typedef 阅读全文

posted @ 2019-11-07 16:52 choco莉特 阅读(1264) 评论(0) 推荐(0) 编辑

摘要:一、二叉树的存储结构 ————顺序存储(一维数组)——— 1 #define MaxSize 100 //假设二叉树最大编号为99 2 typedef char DataType; //定义二叉树节点的数据类型,假设为char型 3 typedef struct{ 4 DataType data[M 阅读全文

posted @ 2019-11-07 14:16 choco莉特 阅读(604) 评论(0) 推荐(0) 编辑

摘要:一、树的存储结构 ——————顺序存储(一维数组)—————— 1.双亲表示法: 1 #define MaxSize 100 //假设树中最多有100个节点 2 //1.定义树节点的数据类型,假设为char型 3 typedef char DataType; 4 typedef struct{ 5 阅读全文

posted @ 2019-11-06 11:54 choco莉特 阅读(608) 评论(0) 推荐(0) 编辑

摘要:1 #include <stdio.h> //增+删+取栈顶+初始化+判空+输出+销毁 2 #include <stdlib.h> 3 #include <malloc.h> 4 typedef int DataType; 5 typedef struct Node { 6 DataType dat 阅读全文

posted @ 2019-11-05 13:55 choco莉特 阅读(1206) 评论(0) 推荐(0) 编辑

摘要:1 #include <stdio.h> //增+删+取栈顶+初始化+判空+输出 2 #define StackSize 100 3 typedef int DataType; 4 typedef struct{ 5 DataType data[StackSize]; 6 int top; 7 }S 阅读全文

posted @ 2019-11-03 19:15 choco莉特 阅读(2570) 评论(1) 推荐(0) 编辑

摘要:1 #include <stdio.h> //增+删+改+查+初始化+输出 2 #include <stdlib.h> 3 typedef struct line{ 4 struct line * prior; 5 int data; 6 struct line * next; 7 }line; 8 阅读全文

posted @ 2019-11-03 19:08 choco莉特 阅读(571) 评论(0) 推荐(0) 编辑

摘要:1 #include <stdio.h> //增+删+改+查+初始化+输出 2 #include <stdlib.h> 3 typedef struct Link { 4 int elem; 5 struct Link *next; 6 }link; 7 link * initLink(); 8 / 阅读全文

posted @ 2019-11-03 19:04 choco莉特 阅读(1323) 评论(0) 推荐(0) 编辑

摘要:1 #include<stdio.h> //增+删+改+初始化+输出 2 #include<stdlib.h> 3 #define MaxSize 10 此数决定了后面插入数据的多少,超过该数字输出顺序表的时候不是正确的数 4 typedef int ElementType; 5 struct Sq 阅读全文

posted @ 2019-11-03 19:02 choco莉特 阅读(3818) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示