数据结构-实现
数据结构
早茶&&月光
这个作者很懒,什么都没留下…
展开
-
数据结构之C++实现最小生成树克鲁斯卡尔(Kruskal)算法
数据结构之C++实现最小生成树克鲁斯卡尔(Kruskal)算法#include <iostream>#include <cstdlib>#include <cmath>#include <ctime>using namespace std;#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0typedef int Status; /* Status是函数的类型,其值是函数结果状态代原创 2021-08-29 16:43:28 · 620 阅读 · 0 评论 -
数据结构之C++实现最小生成树普利姆(Prim)算法
数据结构之C++实现最小生成树普利姆(Prim)算法#include <iostream>#include <cstdlib>#include <cmath>#include <ctime>using namespace std;#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXEDGE 20#define MAXVEX 20#define GRAPH原创 2021-08-29 16:42:42 · 418 阅读 · 0 评论 -
数据结构之C++实现栈与队列的建立及插入删除操作
数据结构之C++实现栈与队列的建立及插入删除操作栈的顺序存储结构#include <iostream>using namespace std;#define MAXSIZE 50class SqStack{public: SqStack(); //~SqStack(); void Push(int x);//在栈顶插入元素x void Pop(void);//删除栈顶元素 void show(void);private: int d原创 2021-08-29 16:38:00 · 818 阅读 · 0 评论 -
数据结构之C++实现图的邻接矩阵、邻接表、深度优先DFS、广度优先BFS
c++实现图的邻接矩阵、邻接表、深度优先DFS、广度优先BFS#include "stdio.h" #include "stdlib.h" #include "math.h" #include "time.h"#include <iostream>using namespace std;#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXVEX 100 /* 最大顶点数,应由用户定原创 2021-08-29 16:41:13 · 671 阅读 · 0 评论 -
数据结构之C++实现树的建立及前序遍历_中序遍历_后序遍历
数据结构之C++实现树的建立及前序遍历_中序遍历_后序遍历#include <iostream>using namespace std;#define MAX_TREE_SIZE 50//双亲表示法struct PTNode{ int data;//节点数据 int parent;//双亲位置};class PTTree{public: PTNode nodes[MAX_TREE_SIZE];//节点数组 int r,n;//根节点的位置和节点原创 2021-08-29 16:39:40 · 311 阅读 · 0 评论 -
c++ 实现线性表_数组_链表_顺序存储结构_链式存储结构
c++ 实现线性表数组#include <iostream>#include "stdlib.h"using namespace std;#define MAXSIZE 20 //设置存储空间初始分量#define OK 1#define ERROR 0typedef int ElemType;//ElemType 相当与inttypedef int Status;class list1{public: list1(); //~list1(); S原创 2021-08-29 16:24:20 · 209 阅读 · 0 评论 -
数据结构之C++ 实现线性表_数组_链表_顺序存储结构_链式存储结构
数据结构之C++ 实现线性表_数组_链表_顺序存储结构_链式存储结构数组#include <iostream>#include "stdlib.h"using namespace std;#define MAXSIZE 20 //设置存储空间初始分量#define OK 1#define ERROR 0typedef int ElemType;//ElemType 相当与inttypedef int Status;class list1{public: list1原创 2021-08-29 16:35:42 · 125 阅读 · 0 评论 -
数据结构之C++实现最短路径迪杰特斯拉(dijkstra)算法
数据结构之C++实现最短路径迪杰特斯拉(dijkstra)算法.md#include <iostream>#include <cstdlib>#include <cmath>#include <ctime>#include "sys/io.h"using namespace std;#define OK 1#define ERROR 0#define TRUE 1#define FALSE 0#define MAXEDGE 20#de原创 2021-09-01 22:41:40 · 525 阅读 · 0 评论