原创 圖結構練習——最短路徑

#include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f //定義最大值 int ma[150][150],v[150],dist[150]; int vis

原创 SPFA和前向星(適合邊和點多的情況)

``` #include<bits/stdc++.h> using namespace std; #define inf 0x3f3f3f3f struct node { int v,w; int next; }edge

原创 字典樹,沒有完成

這裏寫代碼片

原创 數據結構實驗之圖論四:迷宮探索

#include <bits/stdc++.h> using namespace std; int mmp[1010][1010]; //建立鄰接矩陣存儲圖 int vis[1010]; //儲存已遍歷的結點 int

原创 數據結構實驗之圖論七:驢友計劃

#include <bits/stdc++.h> using namespace std; #define INF 0x3f3f3f3f struct node { int fee; int w; }ma[511][51

原创 數據結構實驗之圖論二:圖的深度遍歷

#include <bits/stdc++.h> using namespace std; int visit[150]; int k; int ma[150][150]; int flag; int b[150]; void DFS(i

原创 Catch That Cow

#include <bits/stdc++.h> using namespace std; int visit[200000]; struct node { int data,step; }s,b[200000]; int n,m

原创 數據結構實驗之二叉樹六:哈夫曼編碼

#include<stdio.h> #include<string.h> #include<stdlib.h> #include<algorithm> #include<malloc.h> using namespace std; ch

原创 平衡二叉樹 非遞歸(未完成)

#include <bits/stdc++.h> typedef struct node { int data; struct node *l,*r,*par; }*tree; int length(tree root)

原创 數據結構實驗之圖論一:基於鄰接矩陣的廣度優先搜索遍歷(二)

#include <bits/stdc++.h> using namespace std; int gra[105][105]; //建立鄰接矩陣存儲圖 int que[200];

原创 二叉排序樹

#include<bits/stdc++.h> using namespace std; typedef struct node { int data; struct node *l,*r; }*tree; int fla

原创 《平衡二叉樹》

#include <bits/stdc++.h> typedef struct node { int data; struct node *l,*r; }*tree; int length(tree root) {

原创 人活着系列之芳姐和芳姐的豬(floyd算法)

#include <bits/stdc++.h> #define INF 0x3f3f3f3f using namespace std; int ma[620][620]; void floyd(int n) { int i,j,