- 博客(10)
- 收藏
- 关注
原创 广度优先搜索BFS代码实现
main.cpp#include<stdio.h>#include<stdlib.h>#include"BFS.h"#include"Queue.h"void main(){ printf("无向图\n"); MGraph Graph; Graph = BuildGraph(); BFS(Graph,1);}Queue.h#ifndef QUE...
2020-01-21 20:35:08 310
原创 深度优先搜索DFS代码实现
Init.h文件#ifndef INIT#include<stdio.h>#include<stdlib.h>constexpr auto MaxVertexNum = 100;typedef int Ver; //顶点下标typedef int WeigthType; //边的权值typedef int DataType; //顶点的数据类型/...
2020-01-21 18:21:22 447
原创 用邻接表实现图的构建
#include<stdio.h>#include<stdlib.h>#define MaxVertexNum 100typedef int Vertex; //顶点下标typedef int WeigthType; //边的权值typedef int DataType; //顶点的数据类型//边的定义typedef struct ENode { Ve...
2020-01-16 17:44:15 390
原创 用邻接矩阵创建图
#include<stdio.h>#include<stdlib.h>#define MaxVertexNum 100 //图的最大节点#define INFINITY 0xFFFFtypedef int Vertex; //顶点下标typedef int WeigthType; //边的权值typedef int DataType; //顶点的数据类型...
2020-01-16 15:03:52 663
原创 用最小堆实现哈夫曼树
HuffmanTree.h文件#ifndef HUFFMANTREE#include<stdlib.h>#include<stdio.h>#define MaxCapacity 1000#define MAXDATA 0xFFFFtypedef struct HuffmanNode{ int weight; struct HuffmanNode* lc...
2020-01-13 18:00:04 2691 1
原创 堆操作(初始化,插入,删除最大节点,构建最大堆)
#include<stdio.h>#include<stdlib.h>typedef struct HNode { int* data; int Size; int Capacity;}Heap;typedef Heap MaxHeap;#define MAXDATA 1000void InitHeap(MaxHeap* &h, int M...
2020-01-11 17:22:54 331
原创 二叉树动态插入删除
#include<stdio.h>#include<stdlib.h>typedef struct binTree { int data; struct binTree* left; struct binTree* right;}BT;void creatTree(BT*& tree){ int a; scanf_s("%d", &a...
2020-01-10 22:59:03 226
原创 二叉搜索树(静态)
二叉树创建,查找,最大值 ,最小值#include<stdio.h>#include<stdlib.h>typedef struct binTree{ int data; struct binTree* left; struct binTree* right;}BT;void creatTree(BT* &tree){ int a; sca...
2020-01-09 23:30:52 358
原创 51单片机实验课代码(简单版)
流水灯/*******************************************************************头文件添加区*******************************************************************/#include<STC12C5A60S2.h>/****************...
2020-01-09 15:00:56 1076
原创 数据结构代码大全(简单版)
数据结构代码大全(简单版)顺序表创建,插入,删除,打印#include "stdio.h"#include "stdlib.h"#define MAX_INIT_SIZE 100#define LISTINCREMENT 10typedef struct{ int* elem; int length; int listsize;}SqList;void InitL...
2020-01-09 14:40:55 15511 5
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人