BFS & DFS TraversalBreadth-first and depth-first search from first principles to LLM reasoning systems.