GATE DA 2024 · Question 51 · Programming, Data Structures and Algorithms · Multiple select (MSQ) · 2 marks · no negative marks

Consider the directed acyclic graph (DAG) below:
Which of the following is/are valid vertex orderings that can be obtained from a topological sort of the DAG?

Directed acyclic graph with seven vertices P, Q, R, S, T, U, V. Directed edges: P → Q, R → Q, Q → S, Q → V, S → U, V → T. Layout: P and R at the top, Q in the middle, S and V below Q, U below S and T below V.
  1. (A) P Q R S T U V
  2. (B) P R Q V S U T
  3. (C) P Q R S V U T
  4. (D) P R Q S V T U
Answer

Answer (B), (D)

Answer from the official GATE DA 2024 answer key.

The step-by-step solution, where available, is part of GATE DA Pro. See what Pro includes