Code: https://gist.github.com/jrjames83/eef...
Without worrying about the differences between breadth first search and depth first search, we first say, "hey, how can we visit all nodes in a graph using a function in python?".
A working knowledge of control flow (while statement), lists and dictionaries is assumed, but I step through the algorithm very slowly and deliberately.
It turns out that the differences between DFS and BFS are fairly minor and in my view, focusing on them initially leads to needless confusion.
Once you have a grasp of the fundamental algorithm, minor differences in managing your route plan queue or stack, give rise to the DFS or BFS distinction, almost without even trying.
Next we'll outline those differences.
Auf dieser Seite können Sie das Online-Video Python Graph Traversals Explained in Plain English mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Jeffrey James 25 Februar 2018 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 3,547 Mal angesehen und es wurde von 91 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!