Skip to content
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

Merged
merged 5 commits into from
Oct 26, 2024
Merged

[Tony] WEEK 11 Solutions #547

merged 5 commits into from
Oct 26, 2024

Conversation

TonyKim9401
Copy link
Contributor

@TonyKim9401 TonyKim9401 commented Oct 22, 2024

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@TonyKim9401 TonyKim9401 requested a review from HC-kang October 22, 2024 05:09
@TonyKim9401 TonyKim9401 changed the title Maximum Depth Of Binary Tree [Tony] WEEK 11 Solutions Oct 22, 2024
@TonyKim9401 TonyKim9401 marked this pull request as ready for review October 24, 2024 23:00
@TonyKim9401 TonyKim9401 requested a review from a team as a code owner October 24, 2024 23:00
Copy link
Contributor

@HC-kang HC-kang left a 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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

엇 재귀 스택도 고려해주셔야 할 것 같습니다!

Copy link
Contributor

@HC-kang HC-kang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이번 한 주도 고생하셨습니다!

@TonyKim9401 TonyKim9401 merged commit af10a3a into DaleStudy:main Oct 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants