Iterative Flood Fill Process

Grid

Stack

Step 1: Initial grid with starting position

The flood fill algorithm is used to fill connected regions with a new value, like the "paint bucket" tool in image editors.

In this visualization, we're using a stack-based approach to keep track of positions that need to be processed.

Press "Next" to see how the algorithm works step by step.