
数据结构
梅子猪猪
努力努力努力呀
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
数据结构——进制转换
#include<stdio.h> #include<stdlib.h> #define STACT_INIT_SIZE 100 //存储空间初始分配量 #define STACKINCREMENT 100 //存储空间分配增量 typedef struct { int *base; //栈底指针 int *top; //栈顶指针 in...原创 2019-07-06 12:16:52 · 1000 阅读 · 0 评论 -
数据结构——图的存储(十字链表)
#include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX_VERTEX_NUM 20 #define MAX 20 #define error -1 #define ok 1 //弧节点 typedef struct ArcBox { int tailvex,he...原创 2019-07-06 12:15:29 · 252 阅读 · 0 评论 -
数据结构——图的存储(邻接矩阵)
#include<stdio.h> #include<string.h> #include<stdlib.h> #define MAX 20 #define MAX_VERTEX_NUM 20 #define INF -1 #define error -1 //邻接矩阵 typedef struct ArcCell { int adj; }ArcCel...原创 2019-07-06 12:15:08 · 229 阅读 · 0 评论 -
数据结构——图的存储(邻接表)
#include<stdio.h> #include<string.h> #include<stdlib.h> #define MAX_VERTEX_NUM 20 #define MAX 20 const int error=-1; const int ok=1; //表节点 typedef struct ArcNode { int adjvex; ...原创 2019-07-06 12:15:59 · 162 阅读 · 0 评论 -
数据结构——离散事件模拟实验
#include<stdio.h> #include<stdlib.h> #include<time.h> typedef struct { int OccurTime; //事件发生时刻; int NType; //0表示到达事件,1~4表示四个窗口的离开事件 }Event; //事件类型,有序链表LinkList的数据元...原创 2019-07-06 12:11:02 · 357 阅读 · 0 评论 -
数据结构——图的遍历(BFS广度优先)
//无向图 //邻接矩阵 //有权值 //广度优先遍历 //使用了队列 准备工作: #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX_VERTEX_NUM 20 #define MAX 20 #define INF -1 const int error=-1; #...原创 2019-07-06 12:14:45 · 390 阅读 · 2 评论 -
数据结构——构建Huffman树求Huffman编码
#include<stdio.h> #include<stdlib.h> #include<string.h> //一个节点的包含的信息 typedef struct { unsigned int weight; //权重 unsigned int parent; //父节点的下标 unsigned int lchild; //左孩子的下标 ...原创 2019-07-06 12:16:15 · 550 阅读 · 0 评论 -
数据结构——二叉树的建立(先序)
先序序列建立二叉树的二叉链表 注意:int data;//结点的信息存储是int型的。若是要使用其他类型请自主转换; lchild,rchild分别分别指向左孩子和右孩子; #include<stdio.h> #include<stdlib.h> #define ok 1 #define error 0 //二叉树的二叉链表存储表示 typedef struct...原创 2019-07-06 12:16:29 · 1528 阅读 · 0 评论 -
数据结构——整数四则运算
#include<stdio.h> #include<stdlib.h> #define STACT_INIT_SIZE 100 //存储空间初始分配量 #define STACKINCREMENT 100 //存储空间分配增量 typedef struct { int *base; //栈底指针 int *top; //栈顶指针 i...原创 2019-07-06 12:17:41 · 660 阅读 · 0 评论 -
数据结构——电话本-链表-不带头结点
//记录书本的名称和价格; //用单向链表,实现了创建链表,删除节点, //插入节点,展示链表,释放节点等功能 #include<stdio.h> #include<stdlib.h> //声明函数原型 struct link *AppendNode(struct link *head,int &n); //创建链表 struct link *delNod...原创 2019-07-06 12:19:32 · 196 阅读 · 0 评论 -
数据结构——二叉树的遍历
#include<stdio.h> #include<stdlib.h> typedef struct BiTNode { char data; struct BiTNode *lchild,*rchild; }BiTNode,*BiTree; //函数原型: int CreateTree(BiTree &T); void PreOrder...原创 2019-04-23 23:25:23 · 862 阅读 · 0 评论 -
数据结构——电话本-顺序表
//电话号码查询系统 #include<stdio.h> #include<stdlib.h> #include<string.h> #define LIST_INIT_SIZE 100 //确定分配空间大小 //联系人信息结构体类型 typedef struct contato { char name[20]; char phone[20];...原创 2019-07-06 12:11:24 · 1150 阅读 · 0 评论 -
数据结构——电话本-链表-带头结点
//电话簿 //功能:保存,插入,删除,输出电话号码信息, #include<stdio.h> #include<stdlib.h> //声明函数原型 struct link *AppendNode(struct link *head,int &n); //创建链表 struct link *delNode(struct link *head,int &...原创 2019-07-06 12:19:12 · 269 阅读 · 0 评论 -
数据结构——四则运算-小数
#include<stdio.h> #include<stdlib.h> #define STACT_INIT_SIZE 100 //存储空间初始分配量 #define STACKINCREMENT 100 //存储空间分配增量 typedef struct { float *base; //栈底指针 float *top; //栈顶指...原创 2019-07-06 12:17:28 · 371 阅读 · 0 评论 -
数据结构——迷宫
#include<stdio.h> #include<stdlib.h> #define SIZE 100 //数组行列的最大范围 #define STACT_INIT_SIZE 100 //存储空间初始分配量 #define STACKINCREMENT 100 //存储空间分配增量 typedef struct { int x; i...原创 2019-07-06 12:17:07 · 253 阅读 · 0 评论 -
数据结构——图的遍历(DFS深度优先)
1.使用邻接矩阵存储图 2.无向图 3.深度优先遍历顶点(递归) 准备部分: #include<stdio.h> #include<stdlib.h> #include<string.h> #define MAX_VERTEX_NUM 20 #define MAX 20 #define INF -1 #define error -1 #define ...原创 2019-07-06 12:15:48 · 360 阅读 · 0 评论