Search⌘ K
AI Features

Challenge: Implement breadth-first search

Learn to implement the breadth-first search algorithm by completing the doBFS() function. Understand how to track distances and predecessors for each vertex to map shortest paths from a source in graph traversal.

We'll cover the following...

Implement BFS

In this step, you'll finish implementing the doBFS() function, which performs a breadth-first search on a graph and returns an array of objects describing each vertex.

For each vertex vv ...