Alphabetical Build Order
Six build targets with dependency edges u → v meaning u must be built before v:
1→3, 2→3, 3→5, 4→5, 2→4, 1→6, 6→5
Starting in-degrees:
| target | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| in-degree | 0 | 0 | 2 | 1 | 3 | 1 |
You run Kahn's algorithm with a min-heap in place of the queue, so among all ready targets you always take the smallest number. Which order comes out?
Sign in to answer questions and track your progress
Sign In