Skip to content

Glossary: Data Structures and Algorithms in Go

Depth-first search (DFS)

Also written: DFS, depth-first search

Exploring a graph as deep as possible down one road before backing up to try the next. It finds everything reachable and is often written recursively.

Where the book teaches it

Related terms

Breadth-first search (BFS)RecursionVisited setO(V + E)