// TOPIC
#shortest-path
2 articles
◆◆◆AdvancedGoogleAmazon
01Shortest Paths (Dijkstra, Bellman-Ford, BFS)
Pick the right shortest-path algorithm the first time: BFS for unweighted graphs, Dijkstra with a heap for non-negative weights, Bellman-Ford when negative edges appear. Concrete worked examples, a decision table, and every gotcha that costs people the interview.
#graphs#shortest-path#dijkstra
13 min◆◆IntermediateAmazonGoogle
02BFS Patterns
Queue-driven level-by-level traversal and why breadth-first search is the only guaranteed way to find shortest paths in unweighted graphs. Templates, traps, and four worked problems.
#graphs#bfs#traversal
11 min