DOKICODE
Study room

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.

47 problemsRating 1461–25824 Chapters
Open the study room

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

II. Grid BFS

III. Grid 0-1 BFS

IV. Comprehensive Grid Applications

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