![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
IT_xingshui
这个作者很懒,什么都没留下…
展开
-
图的邻接表表示以及深度优先搜索广度优先搜索
图及对应的邻接表如下:代码如下:datastruct.h#define MaxSize 5 typedef struct{ int data[MaxSize]; int front; // 队头 int rear; // 队尾}SqQueue;void initQueue(SqQueue &qu);...原创 2019-12-08 16:37:14 · 1288 阅读 · 0 评论 -
哈夫曼树的算法实现
#include <stdio.h>#include<stdlib.h>#include <conio.h>#include <string.h>#define n 5 // 定义哈夫曼树中叶子节点个数 #define m 9 // 哈夫曼树结点用一个大小为2n-1 的向量存储typedef struct{ i...原创 2019-11-28 11:23:36 · 823 阅读 · 0 评论 -
二叉树建立,遍历,搜索,中序线索化
#include <stdio.h>#include<stdlib.h>#include <conio.h>#include <string.h>typedef char DataType;typedef struct node{ DataType data; // 数据域 int l...原创 2019-11-24 23:58:42 · 135 阅读 · 1 评论 -
字符串匹配之BF算法
#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>#define maxSize 6 struct Str{ char *ch; int length;};int index(Str *&...原创 2019-11-06 16:04:02 · 148 阅读 · 0 评论 -
线性表的链式存储及其基本操作
#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>typedef struct Link{ int elem; struct Link *next;}link;/* error 初始化操...原创 2019-10-26 20:28:51 · 455 阅读 · 0 评论 -
线性表的顺序存储及其基本操作
#include "pch.h"#include <stdio.h>#include<stdlib.h>#include <conio.h>#define ListSize 10typedef int DataType;typedef struct{ DataType data[ListSize]; int length;}SeqLi...原创 2019-10-21 21:57:53 · 157 阅读 · 0 评论 -
有序链式表合并
有序链式表合并,有序链式表n,m 其元素均由小到大的升序排列。将它们合并成一个顺序表C,C的元素也是由小到打的升序排列#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>/** 单链表归并**/ty...原创 2019-10-21 21:47:20 · 415 阅读 · 0 评论 -
链栈及基本操作的实现
#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>// 因为栈链结点是动态分配的,不考虑栈溢出typedef struct LNode{ int data; struct LNode *next...原创 2019-10-15 22:35:33 · 201 阅读 · 0 评论 -
顺序栈及基本操作的实现
#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>// 顺序栈#define MaxSize 5 // 最多存储5个元素typedef char ElemType;typedef struct Sq...原创 2019-10-10 10:47:49 · 169 阅读 · 0 评论 -
队列【链式存储结构及实现】
#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>// 由于链队结点的空间是动态分配的,所以无须考虑队满的运算。// 队结点类型定义typedef struct QNode{ int data;...原创 2019-10-21 09:34:17 · 180 阅读 · 0 评论 -
队列【顺序存储结构及实现】
#include "pch.h"#include <stdio.h>#include <stdlib.h>#include <conio.h>#include <string.h>#define MaxSize 5 typedef struct { int data[MaxSize]; int front; /...原创 2019-10-18 20:51:25 · 142 阅读 · 1 评论