Grid & Matrix
Many problems hand you a 2D grid and ask you to explore it, as in Number of Islands or Rotting Oranges. Treat each cell as a node with up to four neighbors and the usual search methods apply.
The four chapters cover DFS on grids, BFS on grids, 0-1 BFS for moves that cost either zero or one, and problems that combine them. It is a short plan that sits between trees and graph algorithms on the route.
Want company while you work through this list? Sign in, open the study room, and your heroine will bring you the problems one at a time.
I. Grid DFS
§1.1 Fundamentals
II. Grid BFS
§2.1 Fundamentals
III. Grid 0-1 BFS
§3.1 Fundamentals
IV. Comprehensive Grid Applications
§5.1 Classic Problems
It is the second plan on Track 2, after Linked Lists, Trees & Backtracking, and your heroine brings its problems in order, one unsolved problem at a time.
Ratings come from zerotrac's LeetCode contest ratings. Some problems have no zerotrac rating and are marked Unrated.
Open the study room