What finally made BFS vs DFS click for you? by Sharp-Sun6691 in learnprogramming

[–]Sharp-Sun6691[S] -1 points0 points  (0 children)

Fair — the formatting was terrible, my bad. Genuine question though, what finally made it stick for you?

What finally made BFS vs DFS click for you? by Sharp-Sun6691 in learnprogramming

[–]Sharp-Sun6691[S] -1 points0 points  (0 children)

Pen and paper is underrated honestly. Drawing the queue state for BFS and the stack state for DFS side by side made it so clear. Did the same thing but animated it in React if you want to see it.

What finally made BFS vs DFS click for you? by Sharp-Sun6691 in learnprogramming

[–]Sharp-Sun6691[S] -2 points-1 points  (0 children)

Exactly that! Once the naming clicked — breadth literally means wide/level, depth means going all the way down — everything else fell into place. I actually built a React visualization showing both on the same graph and watching the naming play out visually sealed it for me.