mirror of
https://github.com/onyx-and-iris/grokking-algorithms.git
synced 2024-11-15 17:30:52 +00:00
add note to readme
This commit is contained in:
parent
6b947083e4
commit
ab901fef22
@ -1,5 +1,8 @@
|
|||||||
# DFS BFS on rooted tree
|
# BFS DFS on rooted tree (connected acyclic graph)
|
||||||
|
|
||||||
The BFS example uses a queue which results in a breadth first search. When a directory is found its contents are appended to the queue to be processed later
|
The BFS example uses a queue which results in a breadth first search. When a directory is found its contents are appended to the queue to be processed later
|
||||||
|
|
||||||
The DFS example uses the call stack which results in a depth first search. When a directory is found it is recursively passed to files_with_extension to be processed immediately.
|
The DFS example uses the call stack which results in a depth first search. When a directory is found it is recursively passed to files_with_extension to be processed immediately.
|
||||||
|
|
||||||
|
Note. DFS cannot be used to find the shortest path. In the mango seller example, a DFS search may have found a second or third degree
|
||||||
|
seller before a first. However, DFS may be used to find the topological sort.
|
||||||
|
Loading…
Reference in New Issue
Block a user