GATE DA 2024 Q51: Valid topological orderings of a DAG
- Programming, Data Structures and Algorithms
- 2 marks
- MSQ
- No negative marking
Question
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?
Try it: multiple select: one or more correct options
Select all correct options. No negative marking, no partial marks.
Show answer and explanation
Answer: B, D (official GATE 2024 final answer key)
Concept used: In a topological order every edge goes from an earlier vertex to a later one.
First step: Edges: P→Q, R→Q, Q→S, Q→V, S→U, V→T. Any ordering with Q before R, or T before V, is invalid.
Full step-by-step solution
Detailed working, common mistakes and linked mock tests will be available with a free GATEiit account. Log-in is coming soon.
Share this question
Source: official GATE 2024 DA question paper and final answer key, organised by IISc Bangalore. Question paper · Answer key
More Programming, Data Structures and Algorithms PYQs
- 2026 · Q15Expected-time recurrence for randomised-input quicksort
- 2026 · Q16Python mutable default argument output
- 2026 · Q25Binary tree from preorder and inorder traversals
- 2026 · Q31Worst-case comparisons in binary search of 1000 elements
- 2026 · Q39Number of calls made by a Fibonacci-like recursion
- 2026 · Q40Reachability in a graph and its reverse