Skip to main content

4 docs tagged with "Breadth-First Search"

View all tags

01 Matrix

Given a binary matrix, find the shortest distance from each cell to the nearest '0' cell.

Flood Fill

Given a 2D grid representing an image, a starting pixel's coordinates, and a new color, change the color of the starting pixel and all…

Invert Binary Tree

Given the root of a binary tree, invert the tree by swapping its left and right children at each node.

Rotting Oranges

Return the minimum time until no fresh oranges remain, or -1 if impossible.