What is a good method for performing a topological sort? — 1. Calculate in-degree for each node. O(v + e) 2. Go through 0s, add to queue. 3. For each item in queue, look at each connection, and decrement in-degree of each, if they got to 0, add to queue, repeat.
G
1.2K
Google Interview
This flashcard deck made by jwasham contains knowledge about google interview. For more details, please follow https://github.com/jwasham/google-interview-university