26/32
Part 7 of 7 · Follow-upsLearn and do

What interviewers ask next

Need one fixed order? Keep the ready tasks in a heap, for O(E + V log V)

Kahn's leaves the choice of ready task open, and a problem statement may close it: smallest name first, say. Keep the ready tasks in a heap instead of a deque, so each pop takes the smallest.

Predict

The ready tasks go in a heap, smallest name first. Which task comes third?

Pick an answer above to see the rest