Skip to content

Commit 8a8933d

Browse files
authored
Update Graph-Theory.md
1 parent 2554577 commit 8a8933d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Notes/Graph-Theory.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,9 @@ We need to use some data structure that will allow us to visit vertices "_level-
147147
In order to do this, we will be using a _Queue_ since it follows the "_first in, first out_" ordering; this means if we put all the vertices at level _j_ into the queue before the vertices at level _j_+1, we are guaranteed to visit the lower level vertices first.
148148

149149
Below are the steps to follow for BFS:
150-
1. Push the root vertex onto the queue
151-
2. Pop the queue to get the current vertex
152-
3. For each unvisited neighbor of the current vertex, mark them as visited and push them onto the queue
150+
1. Push the root vertex onto the queue
151+
2. Pop the queue to get the current vertex
152+
3. For each unvisited neighbor of the current vertex, mark them as visited and push them onto the queue
153153
4. Go back to step 2 until the queue is empty
154154

155155
```java

0 commit comments

Comments
 (0)