Grid as graph
Each cell is a node; edges go to valid neighbors. BFS/DFS/Union-Find all apply.
Lesson
2D arrays as graphs — islands, paths, and in-place rotations.
Loading solution…
Each cell is a node; edges go to valid neighbors. BFS/DFS/Union-Find all apply.
Showing 24 of the related problems in the 1000-question bank.
Valid Sudoku
Hash Table
Sudoku Solver
Backtracking
Rotate Image
Matrix
Spiral Matrix
Matrix
Spiral Matrix II
Matrix
Unique Paths
DP
Unique Paths II
DP
Minimum Path Sum
DP
Set Matrix Zeroes
Matrix
Search a 2D Matrix
Binary Search
Word Search
Backtracking
Maximal Rectangle
Stack / DP
Number of Islands
Graph
Search a 2D Matrix II
Two Pointers / BS
Pacific Atlantic Water Flow
Multi-source BFS
Max Area of Island
DFS
Rotting Oranges
Multi-source BFS
Reshape the Matrix — Practice 24
Matrix
Game of Life — Practice 26
Matrix
Lucky Numbers in a Matrix — Practice 28
Matrix
Island Perimeter — Practice 31
Matrix
Rotate Image Drill — Practice 33
Matrix
Shift 2D Grid — Practice 35
Matrix
Battleships in a Board — Practice 38
Matrix
Got the lesson?
Mark Matrices & Grids as understood when the ideas stick.