数据结构
Poppy_black
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
递归实现全排序
#include <iostream>using namespace std;const int N = 1000;int vis[N];int val[N];void print(int n,int* x,int l){ int i; bool flag = false; for (i = 0; i < n; i++) { ...原创 2018-12-12 17:24:05 · 960 阅读 · 0 评论 -
带缓冲的火车车厢重排,我是这么做的,欢迎指教
#include <iostream>#include <cmath>#include <string>#include <stack>#include<queue>using namespace std;const int N = 105;int dir[4][2] = { 0,1,1,0,0,-1,-1,0};...原创 2018-12-16 15:54:58 · 367 阅读 · 0 评论 -
简单迷宫问题
#include <iostream>#include <cmath>#include <string>#include <stack>#include<queue>using namespace std;const int N = 105;int dir[4][2] = { 0,1,1,0,0,-1,-1,0};...原创 2018-12-16 15:20:47 · 342 阅读 · 0 评论 -
简单树
#include <iostream>#include <cmath>#include <string>using namespace std;const int F = 3;struct node{ string s; node *parent, *child[F]; int val;};struct tree { ...原创 2018-12-21 13:27:21 · 508 阅读 · 0 评论 -
堆栈迷宫搜索
#include <iostream>#include <cmath>#include <string>#include <stack>using namespace std;const int N = 105;int dir[4][2] = { 0,1,1,0,0,-1,-1,0};struct P { int x,...原创 2018-12-15 17:43:41 · 326 阅读 · 0 评论 -
简单火车车厢重排
#include <iostream>#include <cmath>#include <string>using namespace std;const int N = 105;int st[N];int main(){ int n; cin >> n; int sp[N]; for (int i =...原创 2018-12-15 17:04:10 · 612 阅读 · 0 评论 -
汉诺塔
#include <iostream>#include <cmath>#include <string>using namespace std;const int N = 105;void hanio(char a, char b, char c, int n){ if (n == 1) { cout <<...原创 2018-12-15 14:57:25 · 149 阅读 · 0 评论 -
括号匹配
#include <iostream>#include <cmath>#include <string>using namespace std;const int N = 105;struct node { int xs[N]; int val; node() { for (int i = 0; i &l...原创 2018-12-15 14:48:37 · 185 阅读 · 0 评论 -
凸包
#include <iostream>#include <cmath>#include <opencv2/opencv.hpp>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;usin...原创 2018-12-14 14:05:42 · 186 阅读 · 0 评论 -
箱子排序
#include "Matrix.h"const int N = 105;int a[N];int main(){ int n; cin >> n; int mx, mn; cin >> a[0]; mn = mx = a[0]; for (int i = 1; i < n; i++) { ...原创 2018-12-13 15:38:16 · 310 阅读 · 0 评论 -
基数排序
#include "Matrix.h"const int N = 105;int a[N];void srotbase(int bas,int n){ int out[N]; int buck[11]; buck[10] = 0; for (int i = 0; i < 10; i++) buck[i] = 0; for (in...原创 2018-12-13 15:27:22 · 162 阅读 · 0 评论 -
简单并查集
#include "Matrix.h"const int N = 105;int x[N];int pre[N];void init(int n){ for (int i = 0; i < n+1; i++) pre[i] = i;}int findf(int x){ if (pre[x] == x) return x; return ...原创 2018-12-13 14:56:02 · 155 阅读 · 0 评论 -
排序
#include <iostream>using namespace std;const int N = 10;int mark[N];int x[N];int main(){ int n; cin >> n; for (int i = 0; i < n; i++) { cin >> x[i];...原创 2018-12-12 17:33:51 · 159 阅读 · 0 评论 -
机器调度问题,请不吝赐教
#include <iostream>#include <cmath>#include <vector>#include <algorithm>using namespace std;const int N = 101;struct node{ int val; int id;};bool cmp(node a, n...原创 2018-12-23 15:53:55 · 412 阅读 · 0 评论
分享