// TOPIC

#bfs

7 articles

Beginner
01

Graphs: Everything Is Connected

The graph data structure models the real world — maps, social networks, dependencies — better than any other. Learn how nodes and edges work, how to represent them, and how BFS and DFS let you actually do something useful with them.

#graphs#data-structures#bfs
10 min
BeginnerAmazonGoogle
02

Queues and Deques

The queue data structure enforces one rule — first in, first out — and that rule shows up everywhere from BFS to task schedulers. Learn how to get O(1) on both ends without the hidden tax of a naive array.

#queues#data-structures#bfs
10 min
◆◆IntermediateGoogleMeta
03

Graphs

The data structure that models everything connected — social networks, road maps, dependency chains, and more. Master representations, traversals, and the "model it as a graph" reframe that unlocks whole categories of problems.

#graphs#data-structures#bfs
11 min
◆◆IntermediateAmazonMeta
04

Binary Trees and Traversals

Master binary tree traversal — inorder, preorder, postorder, and level-order — and the recursive mindset that makes dozens of tree problems click instantly.

#trees#binary-trees#traversals
11 min
◆◆IntermediateGoogleAmazon
05

Topological Sort

Order the nodes of a DAG so every edge points forward — the algorithm that drives build systems, package managers, course schedulers, and anything else that lives and dies by dependency ordering.

#graphs#dag#topological-sort
13 min
◆◆◆AdvancedGoogleAmazon
06

Shortest 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
07

BFS 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