Graph Theory37 sections · 1633 units
Open in CourseQuiz: Kahn's vs DFS Topological Sort
Knowledge check
Check Your Understanding
You need the lexicographically smallest topological ordering. Which approach should you use?
- A.DFS-based topological sort with a stack
- B.Either approach works. Just sort the result afterward
- C.Kahn's algorithm with a min-heap instead of a regular queue
- D.Run both and pick the smaller one