Open In App

GATE | GATE-CS-2014-(Set-1) | Question 22

Like Article
Like
Save
Share
Report

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

GATECS2014Q22
(A) The graph doesn’t have any topological ordering
(B) Both PQRS and SRPQ are topological ordering
(C) Both PSRQ and SPRQ are topological ordering
(D) PSRQ is the only topological ordering


Answer: (C)

Explanation: The graph doesn’t contain any cycle, so there exist topological ordering.

P and S must appear before R and Q because there are edges from P to R and Q, and from S to R and Q.

See Topological Ordering for more details.


Quiz of this Question


Last Updated : 28 Jun, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads