From ab901fef22aa6f12eb6196992fff803512e5c0d6 Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Fri, 12 Jan 2024 13:33:29 +0000 Subject: [PATCH] add note to readme --- chapter7/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/chapter7/README.md b/chapter7/README.md index 84d0f79..64ed2c1 100644 --- a/chapter7/README.md +++ b/chapter7/README.md @@ -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 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.