Skip to content

[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

Merged
merged 9 commits into from
Feb 22, 2025
Merged

[KwonNayeon] Week 11 #1030

merged 9 commits into from
Feb 22, 2025

Conversation

KwonNayeon
Copy link
Contributor

@KwonNayeon KwonNayeon commented Feb 16, 2025

답안 제출 문제

체크 리스트

  • 우측 메뉴에서 PR을 Projects에 추가해주세요.
  • Projects의 오른쪽 버튼(▼)을 눌러 확장한 뒤, Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 StatusIn Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@KwonNayeon KwonNayeon added the py label Feb 16, 2025
@KwonNayeon KwonNayeon requested a review from a team as a code owner February 16, 2025 06:01
Copy link
Contributor

@gwbaik9717 gwbaik9717 left a 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:
Copy link
Contributor

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

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: 반복문
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 Author

Choose a reason for hiding this comment

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

@gwbaik9717 님 안녕하세요! �코드 꼼꼼히 보고 리뷰 남겨주셔서 감사합니다 👍😊

Copy link
Contributor

Choose a reason for hiding this comment

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

전 global variable를 사용하여 dfs에서 maxDepth 를 갱신하는 식으로 했는데, 이렇게 풀면 메소드 단위에서 답을 얻을 수 있어 더 좋은것 같습니다!

Copy link
Contributor

@TonyKim9401 TonyKim9401 left a 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주차 문제 풀이도 파이팅입니다!

@KwonNayeon
Copy link
Contributor Author

@TonyKim9401 님 항상 리뷰를 자세하게 남겨주셔서, 풀이를 복습하는 데에 큰 도움이 됩니다! 감사합니다 😊

@KwonNayeon KwonNayeon merged commit 9d58b17 into DaleStudy:main Feb 22, 2025
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.

3 participants