⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 12s17 days 22 hours 20 minutes 12 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 17d 22h 20m 12s17 days 22 hours 20 minutes 12 seconds.

Sign in to watch this lesson
Algorithms - Graphs I · 5:28
Set the start cell of a maze on fire and watch the flames spread one step per second: that is breadth-first search, and the second the fire reaches a cell is its shortest distance. We build it from a queue whose front always holds the smallest distance, restore the route with a parent array, see why a cell must be marked when it is pushed (on a complete graph of 2,000 nodes, marking on pop pushes about two million entries), light many sources at once, and use two searches to find every edge on a shortest path.