🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.All nodes with in-degree 0
  2. B.All nodes with out-degree 0
  3. C.Only node 0
  4. 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 →