Given a Directed Acyclic Graph (DAG), return the topological sort of the graph using Depth First Search (DFS).
{
"V": 4,
"adj": [
[],
[
0
],
[
0
],
[
0
]
]
}[
3,
2,
1,
0
]{
"V": 5,
"adj": [
[],
[
0
],
[
1
],
[
2
],
[
3
]
]
}[
4,
3,
2,
1,
0
]{
"V": 3,
"adj": [
[
1,
2
],
[],
[]
]
}[
0,
2,
1
]Sign in to Run Code and Submit