🎙 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 7 of 15

In the DFS method, the topological order is:

In the DFS method, the topological order is:

  1. A.the order in which nodes are first visited
  2. B.the reverse of the order in which nodes finish
  3. C.the finishing order, not reversed
  4. D.the BFS level order
Answer & explanation

Correct answer: the reverse of the order in which nodes finish

A node finishes after all nodes that depend on it, so reversing the finishing order puts it before them.

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 →