Search⌘ K
AI Features

Exercise: Print Shortest Path

Explore how to complete a function that prints the shortest path between a source and a target vertex using results from a breadth-first shortest path traversal. Understand how to use graph traversal data to reconstruct and display the exact path efficiently.

We'll cover the following...

The task at hand

There are six lines of code on the right. Five of these are to be dragged and dropped on the left to complete the definition of the function ShowPath.

The ShowPath function takes two parameters: the source vertex ...