description : lintcode 615
topology sorting
dag (directed acyclic graph) => G = ( V, E )
- linear ordering
- no cycle
topology sort (G)
- store neighbor in dictionary edge
- compute indegree
- find node where indegree == 0 & add to queue
- use bfs ( add 1 to count visited node, and decrease indegree by 1 )
- if indegree of beighbor node reduce to 0 add into queue
solution : 615 solution
G = (V, E)
time analysis: O (V+E)