Open In App

GATE | GATE-CS-2007 | Question 5

Like Article
Like
Save
Share
Report

Consider the DAG with Consider V = {1, 2, 3, 4, 5, 6}, shown below. Which of the following is NOT a topological ordering? 

 


(A)

1 2 3 4 5 6

(B)

1 3 2 4 5 6

(C)

1 3 2 4 6 5

(D)

3 2 4 1 6 5



Answer: (D)

Explanation:

In option D, 1 appears after 2 and 3 which is not possible in Topological Sorting. In the given DAG it is directly visible that there is an outgoing edge from vertex 1 to vertex 2 and 3 hence 2 and 3 cannot come before vertex 1 so clearly option D is an incorrect topological sort. But for questions in which it is not directly visible, we should know how to find a topological sort of a DAG. 

 

Hence Option(D) is the correct answer.


Quiz of this Question
Please comment below if you find anything wrong in the above post


Last Updated : 14 Feb, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads