
数据结构
青云66
既然点进来,就顺便关注一下,谢谢
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据结构----简单易懂的快排
#include<bits/stdc++.h>using namespace std;int a[101],n;int kp(int a[],int s,int e)//排每一个数{ int key=a[s]; while(s<e) { while(s<e&&a[e]>=key) e--;//由于定义的key为a【s】,所以要先...原创 2019-11-29 09:11:38 · 138 阅读 · 0 评论 -
数据结构6----赫夫曼树(哈夫曼树)
给定N个权值作为N个叶子结点,构造一棵二叉树,若该树的带权路径长度达到最小,称这样的二叉树为最优二叉树,也称为哈夫曼树(Huffman Tree)。哈夫曼树是带权路径长度最短的树,权值较大的结点离根较近。哈夫曼编码哈夫曼编码就是在哈夫曼树的基础上构建的,这种编码方式最大的优点就是用最少的字符包含最多的信息内容。根据发送信息的内容,通过统计文本中相同字符的个数作为每个字符的权值,建立哈夫曼树。...原创 2019-11-09 16:34:05 · 696 阅读 · 1 评论 -
数据结构----5、二叉树的建立与前中后序遍历,代码简单易懂
#include<bits/stdc++.h>using namespace std;#define status chartypedef struct tree{ status data; struct tree *lchild; struct tree *rchild;}tree,*btree;void CreatTree(btree & tr){...原创 2019-10-28 13:43:53 · 252 阅读 · 0 评论 -
数据结构----4、循环队列详细易懂代码
#include<bits/stdc++.h>using namespace std;#define MAXN 101#define QelemType int#define Status inttypedef struct{ QelemType *base; int front; int rear;}SqQueue;Status InitQueue(SqQueue...原创 2019-10-28 13:41:19 · 140 阅读 · 0 评论 -
数据结构----3、栈详细代码——菜鸟编写,易懂,可直接运行
#include<bits/stdc++.h>using namespace std;#define MAXSIZE 100#define status inttypedef struct{ int *base; int *top; int stacksize;}SqStack; status InitStack(SqStack &s){ s.base =...原创 2019-10-21 15:01:23 · 227 阅读 · 0 评论