Trees and Graphs in Python: BFS and DFS From Scratch
Trees and graphs in Python are the data structures behind almost everything that has a shape you can draw with dots and lines: a folder tree, a family tree, a social network, a map of roads, the import graph of your own project. This post builds them from scratch with plain classes and dictionaries, then runs breadth-first search (BFS) and depth-first search (DFS) so you can watch the two most important graph algorithms actually move through the data. “Show me ... Read More
