GATE CS 2014, set 1 · Question 23 · Programming and Data Structures · Multiple choice (MCQ) · 1 mark · −1/3 for a wrong answer

Consider the directed graph given below.
Which one of the following is TRUE ?

Directed graph with four vertices arranged in a square: P top-left, Q top-right, R bottom-left, S bottom-right. Directed edges: P → Q (top side), P → R (left side), R → Q (diagonal from bottom-left to top-right), S → Q (right side), S → R (bottom side).
  1. (A) The graph does not have any topological ordering.
  2. (B) Both PQRS and SRQP are topological orderings.
  3. (C) Both PSRQ and SPRQ are topological orderings.
  4. (D) PSRQ is the only topological ordering.
Answer

Answer (C)

Answer from the official GATE CS 2014 answer key.

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