Lintcode 127 Topological Sorting

https://www.lintcode.com/problem/127/description We can follow the steps introduced in https://leetcode-solution.com/breadth-first-search to solve this problem. One thing to note is that, for topological sorting, we do NOT have a variable called visited to record visited nodes while BFS. Why? First of all, let’s ask why we needed it for other BFS’ in the first place? Think about … Continue reading Lintcode 127 Topological Sorting