-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tony] WEEK 11 Solutions #547
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TonyKim9401 님 이번 한 주도 고생 많으셨습니다!
@@ -0,0 +1,37 @@ | |||
// TC: O(n * m) | |||
// n = the length of edges, m = the length of each element list of edges |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
시간 복잡도 판단에 대해 혹시 설명해주실 수 있을까요?
주석에서는(제가 이해하기로는) m이 각 노드에 연결된 엣지 수의 평균이라고 작성해 주신 것 같은데,
그렇다면 현재 문제에서 최대 엣지의 수가 n-1이라는 점을 고려하면 m은 결국 1(상수)가 되지 않을까요?
// TC: O(n) | ||
// visiting all nodes | ||
// SC: O(1) | ||
// constant space complexity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
엇 재귀 스택도 고려해주셔야 할 것 같습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이번 한 주도 고생하셨습니다!
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.