Representation
Prefer adjacency lists. Grid graphs are implicit: 4-direction neighbors with bounds checks.
Lesson
Explore nodes and edges — connectivity, components, and traversals.
Loading solution…
Prefer adjacency lists. Grid graphs are implicit: 4-direction neighbors with bounds checks.
BFS for shortest unweighted path / levels. DFS for components, topology prep, and exhaustive search.
Graph BFS paints frontier vs visited as the queue expands.
Showing 24 of the related problems in the 1000-question bank.
Binary Tree Inorder Traversal
Tree
Validate Binary Search Tree
BST
Same Tree
Tree
Symmetric Tree
Tree
Binary Tree Level Order Traversal
BFS
Binary Tree Zigzag Level Order Traversal
BFS
Maximum Depth of Binary Tree
Tree
Construct Binary Tree from Preorder and Inorder Traversal
Tree
Balanced Binary Tree
Tree
Path Sum
Tree
Flatten Binary Tree to Linked List
Tree
Binary Tree Maximum Path Sum
Tree DP
Word Ladder
BFS
Binary Tree Right Side View
BFS
Number of Islands
Graph
Course Schedule
Topological Sort
Course Schedule II
Topological Sort
Invert Binary Tree
Tree
Kth Smallest Element in a BST
BST
Lowest Common Ancestor of a Binary Tree
Tree
Serialize and Deserialize Binary Tree
Tree
House Robber III
Tree DP
Pacific Atlantic Water Flow
Multi-source BFS
Diameter of Binary Tree
Tree
Got the lesson?
Mark Graphs — BFS & DFS as understood when the ideas stick.