Computer Science EngineeringHardISRO SC (CS)

A DAG has vertices 1..6 and edges 1->2, 2->6, 3->4, 4->5. The number of distinct topological orderings is:

  1. A. 21
  2. B. 20
  3. C. 19
  4. D. 40

Correct answer: B. 20

Count linear extensions by DP over subsets of already-placed vertices: 20.

More Algorithms, Data Structures & Programming (ISRO CS) questions

Exams that ask this topic