Skip to content

Glossary: Coding Interviews in Java

Visited array

Also written: visited, boolean[rows][cols]

A `boolean` array the same size as a grid that records which cells have been seen, so BFS and DFS never process a cell twice. It starts all `false`.

Where the book teaches it

Related terms

BFS (breadth-first search)DFS (depth-first search)Grid