
数据结构
梅子猪猪
努力努力努力呀
展开
-
数据结构——进制转换
#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 · 989 阅读 · 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 · 243 阅读 · 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 · 223 阅读 · 0 评论 -
数据结构——图的存储(邻接表)
#include<stdio.h>#include<string.h>#include<stdlib.h>#define MAX_VERTEX_NUM 20#define MAX 20const int error=-1;const int ok=1;//表节点typedef struct ArcNode{ int adjvex; ...原创 2019-07-06 12:15:59 · 156 阅读 · 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 · 349 阅读 · 0 评论 -
数据结构——图的遍历(BFS广度优先)
//无向图//邻接矩阵//有权值//广度优先遍历//使用了队列准备工作:#include<stdio.h>#include<stdlib.h>#include<string.h>#define MAX_VERTEX_NUM 20#define MAX 20#define INF -1const int error=-1;#...原创 2019-07-06 12:14:45 · 375 阅读 · 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 · 538 阅读 · 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 · 1517 阅读 · 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 · 651 阅读 · 0 评论 -
数据结构——电话本-链表-不带头结点
//记录书本的名称和价格;//用单向链表,实现了创建链表,删除节点,//插入节点,展示链表,释放节点等功能#include<stdio.h>#include<stdlib.h>//声明函数原型struct link *AppendNode(struct link *head,int &n); //创建链表struct link *delNod...原创 2019-07-06 12:19:32 · 191 阅读 · 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 · 858 阅读 · 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 · 1140 阅读 · 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 · 263 阅读 · 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 · 360 阅读 · 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 · 246 阅读 · 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 · 352 阅读 · 0 评论