-->
当前位置:首页 > 题库

PROGRAMMING:Determine whether a directed graph can complete topological sorting

Luz5年前 (2021-05-10)题库480
The output of a directed graph is required to complete the topological sorting, and the graph is required to be represented by adjacency table
###Input format:
The input is vertex VI and vertex VJ, which means that VJ is adjacent to VI; End of input with - 1 - 1
Note that the adjacency table is created by the head insertion method
###Output format:
If the topological sorting can be completed, output 1, otherwise output 0
###Input example:
Here is a set of inputs. For example:
```in
0 1
0 2
0 3
1 2
1 5
1 4
2 5
4 5
5 3
-1 -1
```
###Output example:
```out
one
```







answer:If there is no answer, please comment