⚡ 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 II · 4:28
Prim's algorithm grows a single tree outward from one vertex, always adding the shortest edge that leaves it; on twelve desks of a floor plan, the dashed 'cheapest link' of every outside desk swings and shortens as the tree approaches, for a total of about 50.14 m. Its key is the edge's length, not the route's (mixing it up with Dijkstra builds a shortest-path tree), and it comes in a dense O(n^2) version that never stores the edges and a heap version for sparse graphs, measured against Kruskal on this Mac.