[Tony] WEEK 11 Solutions - #547
Merged
Merged
Conversation
TonyKim9401
marked this pull request as ready for review
October 24, 2024 23:00
HC-kang
reviewed
Oct 25, 2024
HC-kang
left a comment
Contributor
There was a problem hiding this comment.
@TonyKim9401 님 이번 한 주도 고생 많으셨습니다!
| @@ -0,0 +1,37 @@ | |||
| // TC: O(n * m) | |||
| // n = the length of edges, m = the length of each element list of edges | |||
Contributor
There was a problem hiding this comment.
시간 복잡도 판단에 대해 혹시 설명해주실 수 있을까요?
주석에서는(제가 이해하기로는) m이 각 노드에 연결된 엣지 수의 평균이라고 작성해 주신 것 같은데,
그렇다면 현재 문제에서 최대 엣지의 수가 n-1이라는 점을 고려하면 m은 결국 1(상수)가 되지 않을까요?
| // TC: O(n) | ||
| // visiting all nodes | ||
| // SC: O(1) | ||
| // constant space complexity |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
답안 제출 문제
체크 리스트
In Review로 설정해주세요.