Skip to content

Glossary: Data Structures and Algorithms in JavaScript

Breadth-first search (BFS)

Also written: BFS, breadth-first search

A graph search that visits the start, then its neighbors, then their neighbors, ring by ring, using a queue. Because it reaches places in rings, it finds the route with the fewest stops.

Where the book teaches it

Related terms

Queuevisited setcameFromDepth-first search (DFS)