-
-
Notifications
You must be signed in to change notification settings - Fork 195
[KwonNayeon] Week 11 #1030
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
[KwonNayeon] Week 11 #1030
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.
안녕하세요, @KwonNayeon 님! 아직 solving 상태이시지만, 현재 코드를 기준으로 코멘트를 남겨드렸습니다. 별다른 내용은 없고, 다양한 방식으로 풀이를 시도해주셔서 많이 배우고 갑니다.
# 중간 지점 찾기 | ||
slow = head | ||
fast = head | ||
while fast and fast.next: |
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.
토끼와 거북이 알고리즘의 컨셉과 비슷하게 배열의 중간점을 찾는게 인상적이네요.
Time Complexity: O(n) | ||
- 리스트를 한 번씩 순회하면서 알고리즘의 각 단계를 수행함 | ||
|
||
Space Complexity: O(1) |
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.
저는 공간복잡도를 O(n) 으로 풀었는데, 투포인터를 사용해서 O(1) 으로 줄인점이 흥미롭네요!
|
||
return max(left_depth, right_depth) + 1 | ||
|
||
# Solution 2: 반복문 |
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.
@gwbaik9717 님 안녕하세요! �코드 꼼꼼히 보고 리뷰 남겨주셔서 감사합니다 👍😊
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.
전 global variable를 사용하여 dfs에서 maxDepth 를 갱신하는 식으로 했는데, 이렇게 풀면 메소드 단위에서 답을 얻을 수 있어 더 좋은것 같습니다!
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.
11주차 문제 풀이 고생하셨습니다!
Maximum depth of binary tree 문제 풀이법이 참 좋았던것 같습니다 :)
Reorder List 문제도 LinkedList 의 특성을 잘 살리셔서 풀어주신것 같구요.
미리 approve 남겨 두겠습니다. 토요일까지 남은 문제들도 도전해보시면 좋을것 같아요!
12주차 문제 풀이도 파이팅입니다!
@TonyKim9401 님 항상 리뷰를 자세하게 남겨주셔서, 풀이를 복습하는 데에 큰 도움이 됩니다! 감사합니다 😊 |
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.