![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
数据结构
小刀刺大熊
这个作者很懒,什么都没留下…
展开
-
单链表数组表示(uva-11988)
#include <iostream> #include <istream> #include <sstream> #include <vector> #include <stack> #include <list> #include <map> #include <set> #include <deque> #include <queue> #include <cstring>原创 2020-11-10 14:14:16 · 92 阅读 · 0 评论 -
并查集模板
【代码】并查集模板。原创 2019-09-23 19:06:07 · 218 阅读 · 1 评论 -
矩阵乘法
#include <iostream> #include <ctime> using namespace std; #define SAFEDELETE(a) delete a;a = NULL; struct Matrix { Matrix() :row(0), col(0), data(NULL), boSub(false){}; Matrix(int _row...原创 2019-06-06 21:12:48 · 351 阅读 · 0 评论 -
排序
#include <iostream> #include <functional> #include <mutex> using namespace std; //插入排序 最好情况 O(n) 最坏情况 O(n^2) template <typename FUN> void InsertSort(int *a, int length, FUN...原创 2019-06-06 11:13:47 · 96 阅读 · 0 评论 -
二维前缀和
vector<vector<int>> matrixSum(vector<vector<int>>& mat) { vector<vector<int> > preSum(mat.size()+1,vector<int>(mat[0].size()+1,0)); for (int i = 1; i ...原创 2020-01-26 12:41:21 · 122 阅读 · 0 评论 -
树状数组模板
【代码】树状数组模板。原创 2018-05-16 21:25:37 · 163 阅读 · 1 评论 -
关键路径
纯属儿戏,切莫当真 /* 关键路径 只有一个开始点和一个完成点 */ #include <iostream> #include <vector> using namespace std; #define MAXSIZE 16 struct BaseNode { BaseNode(){ tailIndex = 0; nWeight...原创 2018-05-05 16:30:19 · 134 阅读 · 0 评论 -
求每一对顶点之间的最短距离
/* 求每一对顶点之间的最短距离 邻接矩阵 依次加入各个顶点 */ #include <iostream> #include <iomanip> using namespace std; #define MAXSIZE 32 string GetStr(string s, string s2) { string str; str =...原创 2018-05-03 20:24:13 · 495 阅读 · 0 评论 -
源点到所有顶点的最短路径
//源点到其余各点的最短路径 //从源点出发 遍历邻接点 每次选择最小的路径 作为次长 #include <iostream> #include <string> #include <vector> using namespace std; #define MAXSIZE 256 struct BaseNode { BaseNode(){ ...原创 2018-05-01 17:49:54 · 1027 阅读 · 0 评论 -
求关节点
//low(v) = Min{visited[v] , low(w) ,visited[k]} //visited[v] -> 深度优先 该点访问次序 //low(w) -> 子树 的low 值 //visited[k] -> 回边的 次序 // 条件 low[w] >= visited[v]include include using namespace std;define NODEMA原创 2018-05-01 12:48:09 · 790 阅读 · 0 评论