My checklist: 1) draw the graph on paper first, 2) ask if it's weighted, 3) ask if you need shortest path, all paths, or just connectivity, 4) only then pick BFS/DFS/Dijkstra. Writing code before answering those three questions is what usually causes the freeze.
Ratanak S.
Community moderator · answered 1h ago