数据结构
文章平均质量分 93
数据结构
BeZer0
路漫漫其修远兮,吾将上下而求索
展开
-
数据结构复试问题笔记
数据结构原创 2021-03-12 21:20:32 · 2623 阅读 · 2 评论 -
线性表
线性表顺序表静态存储类型#define MaxSize 50typedef struct{ ElemType data[MaxSize]; int length;}SqList;动态存储类型#define InitSize 100typedef struct{ ElemType *data; int MaxSize,length;}SqList;动态声明L.data=(ElemType*)malloc(sizeof(ElemType)*I原创 2020-08-23 17:42:02 · 194 阅读 · 0 评论 -
栈和队列
栈和队列栈原创 2020-08-25 18:11:06 · 93 阅读 · 0 评论 -
串与模式匹配算法
由简单的朴素模式匹配算法可以发现,在匹配字符时,有一些字符先前已经匹配过了,但是在匹配到下一个字符时会重复与之进行匹配,这就造成了效率上的浪费,因此为了充分利用前面的工作成果,出现了 KMP 算法。原创 2020-08-29 17:47:53 · 807 阅读 · 0 评论 -
树与二叉树
二叉树链式存储结构typedef struct BiTNode{ ElemType data; struct BiTNode *lchild,*rchild;} BiTNode,*BiTree;访问二叉树结点void visit(BiTNode *T){ printf("%d\n",T->data);}先序遍历void PreOrder(BiTree T){ if(T!=NULL) { visit(T);原创 2020-08-31 18:20:34 · 117 阅读 · 0 评论 -
图
存储结构邻接矩阵存储结构#define MaxVertexNum 100typedef char VertexType;typedef int EdgeType;typedef struct{ VertexType Vex[MaxVertexNum]; EdgeType Edge[MaxVertexNum][MaxVertexNum]; int vexnum,arcnum;} MGraph;邻接表存储结构#define MaxVertexNum 100t原创 2020-09-05 18:22:33 · 155 阅读 · 0 评论 -
查找
算法二分查找int Binary_search(SeqList L,ElemType key){ int low=0,high=L.length-1,mid; while(low<=high) { mid=(low+high)/2; if(L.elem[mid]==key) return mid; else if(L.elem[mid]>key) high=mid-1原创 2020-09-09 16:30:56 · 223 阅读 · 0 评论 -
排序
十种排序算法原创 2020-09-12 16:25:25 · 371 阅读 · 0 评论