mirror of
https://github.com/onyx-and-iris/grokking-algorithms.git
synced 2026-04-16 11:33:34 +00:00
clean up repo.
add more notes
This commit is contained in:
9
chapter6/README.md
Normal file
9
chapter6/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# Breadth-First Search
|
||||
|
||||
Can tell you if there's a path between A and B and will find the shortest.
|
||||
|
||||
In these examples, 1st degree Mango sellers are found before 2nd degree, 2nd before 3rd and so on.
|
||||
|
||||
Visted nodes should be stored in a set to ensure no infinite loops.
|
||||
|
||||
Running time for BFS on a directed graph: `O(V + E`) where V = vertices, E = edges.
|
||||
Reference in New Issue
Block a user