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

Sign in to watch this lesson
Algorithms - Graphs I · 3:59
A topological order lines up the vertices of a directed graph so every arrow points forward, and it exists exactly when there is no cycle. We build one two ways on six start-of-day jobs: reversing the DFS finishing order (5 4 1 0 3 2) and Kahn's algorithm, which peels vertices with in-degree zero (4 5 1 0 3 2), checks for cycles and tells you when the order is unique. Then a single left-to-right DP sweep over that order gives the earliest finish times, a 10-minute morning, and its critical chain 4 0 3 2.