Skip to content

Commit 833b9b1

Browse files
done
1 parent edf2d91 commit 833b9b1

File tree

9 files changed

+7
-2
lines changed

9 files changed

+7
-2
lines changed

3_Algorithms/Lab work/Lab 5/A.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Your task is to perform a Breadth-First Search (BFS) starting from node 1 and print the order in which the nodes are visited.
77
'''
88

9+
910
from collections import deque
1011

1112
n, m = map(int, input().split())

3_Algorithms/Lab work/Lab 5/B.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Your task is to perform a Depth-First Search (DFS) starting from node 1 and print the order in which the nodes are visited.
66
'''
77

8+
89
import sys
910
sys.setrecursionlimit(2*10**5 + 10)
1011

3_Algorithms/Lab work/Lab 5/C.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
If no path exists, print −1.
1010
'''
1111

12+
1213
from collections import deque
1314
def solve():
1415
n, m, s, dn = map(int, input().split()) # n = no. of vertices, m = no. of edges, s = start node, dn = destination node

3_Algorithms/Lab work/Lab 5/D.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
If no such path exists, print −1.
66
'''
77

8+
89
from collections import deque
910
def solve():
1011
N, M, S, D, K = map(int, input().split()) # N = no. of vertices, M = no. of edges, S = start node, D = destination node, K = one node between S and D

3_Algorithms/Lab work/Lab 5/E.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Write a code to find if there is any cycle in the graph.
66
'''
77

8+
89
import sys
910
sys.setrecursionlimit(2*10**5 + 10)
1011

3_Algorithms/Lab work/Lab 5/F.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
such that you can collect the maximum number of diamonds
1212
'''
1313

14+
1415
from collections import deque
1516

1617
R, H = map(int, input().split()) # R= rows, H=columns

3_Algorithms/Lab work/prev/1_bfs_3.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
..w.D
2121
.w.w.
2222
.....
23+
2324
'''
2425

2526

3_Algorithms/Lab work/prev/1_bfs_5.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
1 2 1
1919
0 1 0
2020
'''
21-
2221
from collections import deque
2322

2423
def solve():

3_Algorithms/Lab work/prev/1_bfs_7.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
(1,1) (2,1) (3,1) (3,2) (3,3)
1313
'''
1414

15-
1615
from collections import deque
1716

1817
def solve():

0 commit comments

Comments
 (0)