Skip to content

Commit

Permalink
edit : correct #261 code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
EgonD3V committed Oct 21, 2024
1 parent ac155d9 commit e9629f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions course-schedule/EGON.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ def canFinish(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
Memory: 17.85 MB (Beats 99.94%)
Space Complexity: O(c)
- graph ๋ณ€์ˆ˜ ์‚ฌ์šฉ์— O(c)
- graph ๋ณ€์ˆ˜ ์‚ฌ์šฉ์— O(c + p)
- rank ๋ณ€์ˆ˜ ์‚ฌ์šฉ์— O(c)
- queue ๋ณ€์ˆ˜ ์‚ฌ์šฉ์—์„œ ์ตœ๋Œ€ ํฌ๊ธฐ๋Š” graph์˜ ํฌ๊ธฐ์™€ ๊ฐ™์œผ๋ฏ€๋กœ O(c)
> O(c) + O(c) + O(c) ~= O(c)
> O(c + p) + O(c) + O(c) ~= O(c + p)
"""
def solve_topological_sort(self, numCourses: int, prerequisites: List[List[int]]) -> bool:
graph = {i: [] for i in range(numCourses)}
Expand Down

0 comments on commit e9629f7

Please sign in to comment.