Index Ai Academy
Glossary · Phase 7 · Software engineering

Breadth-first search

Also written: BFS

Exploring a graph in rings: everything one step away, then two steps, and so on. It finds the path with the fewest hops.

Try it now

Three frames for sum_to stack up before any of them can return. Then each one finishes, adding its n to the answer from below.

Learn it properly

Recursion, trees and graphs · Functions that call themselves, and the shapes most real data takes. About 35 minutes.

Create a free account See what's in the lesson

Other terms from the same lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write