Add notes for BFS as well
This commit is contained in:
13
notes-and-examples/2026.07.21/breadth-first-search.md
Normal file
13
notes-and-examples/2026.07.21/breadth-first-search.md
Normal file
@@ -0,0 +1,13 @@
|
||||
## Breadth-first search (BFS)
|
||||
|
||||
In the notes on [depth-first search](./depth-first-search.md), we mention that the difference between DFS and BFS is the order in which nodes are traversed.
|
||||
|
||||
Using the same example, what would a breadth-first traversal look like if we start at vertex 0 in this graph?
|
||||
|
||||
```
|
||||
0 --- 1
|
||||
| |
|
||||
3 --- 2
|
||||
```
|
||||
|
||||
Can we also formalize an algorithm for breadth-first search?
|
||||
Reference in New Issue
Block a user