Skip to content

Glossary: Data Structures and Algorithms in C++

Breadth-first search (BFS)

Also written: BFS, breadth-first search

A graph search that visits the start, then all its neighbors, then their neighbors, ring by ring, using a queue and a visited set. It finds the route with the fewest stops.

Where the book teaches it

Related terms

Depth-first search (DFS)Queuevisited setcame_from