my exercises is to find solutions which can help me to understand these puzzle algorithms.
Problem
scheduling problem with precedence constraints.
key
- DAG: a digraph with no directed cycles.
- A digraph has a topological order if and only if it is a DAG.
- Is a given digraph a DAG ?
- Depth-first search
Java
DFS
1 | class Solution { |
Submission Detail
- 42 / 42 test cases passed.
- Runtime: 5 ms, faster than 69.31% of Java online submissions for Course Schedule.
- Memory Usage: 44.6 MB, less than 94.62% of Java online submissions for Course Schedule.