We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae04edd commit dfe084dCopy full SHA for dfe084d
README.md
@@ -73,3 +73,16 @@ c: 1. Dp State: Use f[i] or f[i][j] to represent the answer to a smaller problem
73
f[i][j] = Derive by finding max / min / sum / or of some smaller state
74
75
4. Dp return: return the dp result. Like: such as f[n][m] or max(f[n][0], f[n][1] … f[n][m])
76
+
77
+# Breadth-first search Algorithm
78
+Step 1: Choose any one node randomly, to start traversing.
79
80
+Step 2: Visit its adjacent unvisited node.
81
82
+Step 3: Mark it as visited in the boolean array and display it.
83
84
+Step 4: Insert the visited node into the queue.
85
86
+Step 5: If there is no adjacent node, remove the first node from the queue.
87
88
+Step 6: Repeat the above steps until the queue is empty.
0 commit comments