摘要: /** 图论算法 最小生成树Kruskal 时间复杂度 O(ElogE) Prim 时间复杂度 O(V2) */ #include<stdio.h> #include<vector> #include<queue> #include<algorithm> using namespace std; c 阅读全文
posted @ 2021-03-07 22:36 永恒& 阅读(65) 评论(0) 推荐(0) 编辑
摘要: /** 图论算法 遍历 */ #include<stdio.h> #include<vector> #include<queue> using namespace std; int g[100][100];//邻接矩阵表示法,0代表无边,1代表右边 int visit[100];//0代表没遍历,1 阅读全文
posted @ 2021-03-07 21:31 永恒& 阅读(72) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stdlib.h> #include<queue> struct TNode//树的节点 { int data; struct TNode *l,*r; }; TNode* Create()//建树 { char ch; scanf("%c",& 阅读全文
posted @ 2021-03-07 20:12 永恒& 阅读(34) 评论(0) 推荐(0) 编辑