-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathgraph_bfs.cpp
More file actions
63 lines (63 loc) · 1.45 KB
/
graph_bfs.cpp
File metadata and controls
63 lines (63 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//#include <bits/stdc++.h>
//using namespace std;
//typedef long long ll;
//typedef unsigned long long ull;
//typedef pair <int,int> pint;
//typedef map <int,int> mapii;
//typedef map <char,int> mapci;
//typedef map <string,int> mapsi;
//typedef vector <int> vi;
//typedef vector <ll> vll;
//typedef vector <char> vc;
//typedef set <int> si;
//typedef set <ll> sll;
//typedef set <char> sc;
//#define pb(i) push_back(i) ;
//#define ms(arr) memset(arr,true,sizeof(arr))
//#define deb(x) cout<< #x <<" "<< x<<endl;
//#define loop(i,n) for(int i=0;i<n;i++)
//#define Loop(i,k,n) for(ll i=k;i<=n;i++)
//#define tc int t;cin>>t; while(t--)
//
//vector <bool> vis;
//void edge(vector <int> g[],int a,int b)
//{
// g[a].push_back(b);
// g[b].push_back(a);
//}
//void bfs(vector <int> g[],int s,int V)
//{
// vector <bool> vis(V,false);
// queue <int> q;
// q.push(s);
// while(!q.empty())
// {
// int f=q.front();
// q.pop();
// if(!vis[f]) {
// cout << f << " ";
// vis[f] = true;
// }
// for(auto j:g[f])
// {
// if(!vis[j])
// {
// q.push(j);
// }
// }
// }
//}
//int main()
//{
// int n,e;
// cin>>n>>e;
// vector <int> adj[n];
// int a,b;
// for(int i=0;i<e;i++)
// {
// cin>>a>>b;
// edge(adj,a,b);
// }
// bfs(adj,2,n);
// return 0;
//}