Algorithms

Topological sort is best defined as which of the following?

Correct answer

C. An ordering of vertices in a directed acyclic graph such that for every edge, the source vertex comes before the destination vertex.

Explanation

Topological sort refers to an ordering of vertices in a directed acyclic graph such that for every edge, the source vertex comes before the destination vertex.