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

Can a directed graph have more than one valid topological order?

Can a directed graph have more than one valid topological order?

  1. A.Yes, whenever some nodes have no path between them, they can appear in either order
  2. B.No, the order is always unique
  3. C.Only if the graph has a cycle
  4. D.Only for undirected graphs
Answer & explanation

Correct answer: Yes, whenever some nodes have no path between them, they can appear in either order

In the course graph, Maths and C have no rule between them, so either may come 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 →