-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultisource BFS.cpp
More file actions
35 lines (35 loc) · 773 Bytes
/
Multisource BFS.cpp
File metadata and controls
35 lines (35 loc) · 773 Bytes
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
////
//// Created by rajat joshi on 09-06-2022.
////
//#include<bits/stdc++.h>
//using namespace std;
//
//int main()
//{
// vector<int> sources;
//
// unordered_map<int,bool> vis;
// unordered_map<int,int> dist;
// queue<int> q;
//
// for(int i = 0;i<sources.size();i++){
// vis[sources[i]] = true;
// dist[sources[i]] = 0;
// q.push(sources[i]);
// }
//// then proceed as usual
//
//
// while(!q.empty()){
// int p = q.front();
// q.pop();
//
// for(int i = 0;i< g[p].size();i++){
// if(!vis[g[p][i]]){
// vis[g[p][i]] = true;
// dist[g[p][i]] = dist[p] + 1;
// q.push(g[p][i]);
// }
// }
// }
//}