Course schedule extended

Правка en1, от __SAK__, 2022-10-01 11:02:05

You might have seen the problem Course Schedule on Leetcode [https://leetcode.com/problems/course-schedule/] Here the ans just comes down to finding if there exists a cycle in the graph or not. I wanted to find the how many total courses can I take if not all the courses. One approach I thought was a multisource BFS with maintaining the indegree for each node and updating it but it would be quite slow. Can anyone suggest any faster method?

Теги graph, multisource bfs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский __SAK__ 2022-10-01 11:02:05 469 Initial revision (published)