Skip to content

Glossary: Coding Interviews in JavaScript

DFS (depth-first search)

Also written: DFS, DFS flood fill

A search that follows one path as far as it can, usually by recursion, before backing up. It is used to flood-fill a grid and count islands.

Where the book teaches it

Related terms

Flood fillIslandBFS (breadth-first search)Call stack