Given a directed graph, find a topological order of the graph.
A topological order of a graph nodes is defined as follow:
- For each directed edge
A -> B in graph, node
A must before node
B in the order list.
- The first node in the order can be any node in the graph with no nodes direct to it.
Two valid topological ordering of the graph are:
[0, 1, 2, 3, 4, 5]
[0, 2, 3, 1, 5, 4]