← Quiz: Topological Sort: all 15 questions
Quiz: Topological Sort · Question 2 of 15
In Kahn's algorithm, which nodes go into the queue at the start?
In Kahn's algorithm, which nodes go into the queue at the start?
- A.All nodes with in-degree 0
- B.All nodes with out-degree 0
- C.Only node 0
- D.All nodes, sorted by in-degree
Answer & explanation
Correct answer: All nodes with in-degree 0
In-degree 0 means no unfinished prerequisites, so these tasks can be done first.
Can you get the rest right without peeking?
Take the timed Quiz: Topological Sort quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →