When there are multiple solutions, I want to return the solution where courses are in ascending order. How can I do that by the topological sort algorithm?

1

There are 1 best solutions below

0
sam On

Solved this using PriorityQueue in place of Queue.