Consider the directed graph given below. Which one of the following is TRUE?
Topic-wise GATE CS PYQs with verified steps
GATE CSE 2014 Set 1 · Q13
Time

Select one answerSingle correct
Solution
Official answer: C) Both PSRQ and SPRQ are topological orderings.
Graph TraversalsLet us analyze the dependencies (directed edges) in the given DAG:
Edges from : ,
Edges from : ,
Edges from :
In-degrees of vertices:
(predecessors: )
(predecessors: )
For a valid topological ordering:
Both and must precede and .
must precede .
Therefore, the first two vertices must be and in either order:
If is first, then must follow before , yielding: PSRQ.
If is first, then must follow before , yielding: SPRQ.
Thus, both PSRQ and SPRQ are valid topological orderings, making option (C) correct.
Try the question first, then check your work.
Examiner trap
Check the in-degree of all vertices. Vertices with in-degree 0 can be chosen first, and a node can only appear after all its predecessors have appeared.
This Graph Traversals previous year question is Q13 of the GATE CSE 2014 Set 1 paper. Find more GATE CSE PYQs on Graph Traversals in Algorithms, or browse all GATE CSE PYQs.
Free diagnostic
Take the 20-minute diagnostic: the 3 topics that cost you the most marks, and a rank range. Or sit 5 related Graph Traversals PYQs now with no account.
An official question by email at 7 AM IST, with a link to its verified solution. Unsubscribe in one click.
Graph Traversals has 16 GATE CSE PYQs across 12 papers from 2014 to 2026. 5 of them are 1-mark MCQs like this one, and GATE CSE 2014 Set 1 has 3.
How GATE tests Graph TraversalsIndependent practice explanation verified by the GateAI team. GATE is conducted by the IITs; question text follows the official paper.