package
0.0.0-20241209140624-9fce2a725d55
Repository: https://github.com/elven9/my-leetcode.git
Documentation: pkg.go.dev
# README
Course Schedule
Solution Idx | Time Complexity | Space Complexity | Comment |
---|---|---|---|
1 | O(n * V * E) | O(n) | Naive solution, cycle detection against each node |
2 | O(n) | O(n) | Khan topological sort. Test if given graph is a DAG |
3 | O(V+E) | O(n) | Dfs cycle detection on forest with Done Optimization |