数据结构-存储结构
来源:互联网 发布:域名备案要钱吗 编辑:程序博客网 时间:2024/06/04 17:53
数据结构-存储结构
1. 图的存储结构:
a) 邻接矩阵:
#define MaxVertexNum 100typedef char VertexType;typedef int EdgeType;typedef struct MGragh{VertexType Vex[MaxVertexNum];EdgeType Edge[MaxVertexNum][MaxVertexNum];int vexnum,arcnum;}MGragh;
a) 邻接表法:
#define MaxVertexNum 100typedef struct ArcNode{//边表节点int adjvex;struct ArcNode *next;}ArcNode;typedef struct VNode{//顶点表节点VertexType data;ArcNode *first;}VNode,AdjList[MaxVertexNum];typedef struct AMLGraph{//邻接表AdjList vertices;int vexnum,arcnum;}AMLGraph;
2.二叉树链式存储结构:
typdef int ElemType;typedef struct BiTNode{ElemType data;struct BitNode *lchild,*rchild;}BiTNode,*BiTree;
3.顺序栈的存储结构:
#define MaxSize 50typedef int Elemtype; typedef struct{Elemtype data[MaxSize];int top;}SqStack;
4.栈的链式存储:
typedef struct ThredNode{ElemType data;struct ThreadNode *lchild,*rchild;int ltag,rtag;//0表示指孩子,1表指前驱或后继}ThreadNode,*ThreadTree
typedef int ElemType;typedef struct{ElemType data;struct LinkNode *next;}LinkNode,*LiStack;
5.单链表的存储结构:
typedef int ElemType;typedef struct LNode{ElemType data;struct LNode *next;}LNode,*LinkList;
线索二叉树的存储结构
typedef struct ThredNode{ElemType data;struct ThreadNode *lchild,*rchild;int ltag,rtag;//0表示指孩子,1表指前驱或后继}ThreadNode,*ThreadTree
阅读全文
0 0
- 数据结构 链式存储结构
- 数据结构之存储结构
- 数据结构之存储结构
- 数据结构-存储结构
- 数据结构--链式存储结构
- 【数据结构】字符串顺序存储结构
- 数据结构---->图的存储结构
- 数据结构的链式存储结构
- 数据结构 - 图的存储结构
- 数据结构-树的存储结构
- 数据结构:串的存储结构
- 数据结构---图的存储结构
- 数据结构的顺序存储结构
- 数据结构的链式存储结构
- 数据结构和数据存储结构
- 【数据结构】图的存储结构
- 数据结构-二维数组-存储结构
- 数据结构逻辑结构与存储结构
- 据说这是你想要的iOS 12
- SpringMVC数据绑定
- python和matlab混合编程,并解决error "ImportError: No module named matlab.engine"
- 这次,苹果真的摔得很惨……
- win8--PPTP教程
- 数据结构-存储结构
- 算法学习——递归实践
- 【算法知识总结】回溯法
- 41. First Missing Positive
- Oracle 12c报错:ORA-01078和LRM-00109的解决办法
- GAN系列学习(1)——前生今世
- 组织项目管理成熟度模型OPM3
- MySQL半同步--after_flush
- 二进制位从左到右翻转后的值