Skip to content

Commit b3fe862

Browse files
authored
Update and rename 5.cpp to 1686 Building Teams.cpp
test case for "impossible": 3 3 1 2 1 3 2 3 basically using level order traversal technique using bfs if on the odd level we will give 1 to all the elements and on even level we will give 2 or we can use it using dfs simply maintaining a fucntion dfs(node,flag); where flag will be reverse after each iteration color=flag?1:2;
1 parent 9bf6d35 commit b3fe862

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,20 @@
55
// give me some sunshine, give me some rain ,give me another chance to grow up once again....
66

77
// sab moh maya hai....
8+
9+
/*
10+
test case for "impossible":
11+
3 3
12+
1 2
13+
1 3
14+
2 3
15+
16+
basically using level order traversal technique using bfs if on the odd level we will give 1 to all the elements and on even level we will give 2
17+
or we can use it using dfs simply maintaining a fucntion
18+
dfs(node,flag);
19+
where flag will be reverse after each iteration
20+
color=flag?1:2;
21+
*/
822

923
#include <bits/stdc++.h>
1024
using namespace std;

0 commit comments

Comments
 (0)