Given a Directed Acyclic Graph (DAG) with V vertices and E edges, find any Topological Sorting of that Graph using Breadth-First Search (Kahn's Algorithm).
{
"V": 4,
"adj": [
[],
[
0
],
[
0
],
[
0
]
]
}[
3,
2,
1,
0
]{
"V": 6,
"adj": [
[],
[],
[
3
],
[
1
],
[
0,
1
],
[
0,
2
]
]
}[
5,
4,
2,
3,
1,
0
]{
"V": 3,
"adj": [
[
1
],
[
2
],
[]
]
}[
0,
1,
2
]Sign in to Run Code and Submit