Skip to content

[Chaedie] Week 8 #964

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 7 commits into from
Feb 2, 2025
Merged

[Chaedie] Week 8 #964

merged 7 commits into from
Feb 2, 2025

Conversation

Chaedie
Copy link
Contributor

@Chaedie Chaedie commented Jan 28, 2025

답안 제출 문제

체크 리스트

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

@Chaedie Chaedie requested a review from a team as a code owner January 28, 2025 04:54
@github-actions github-actions bot added the py label Jan 28, 2025
@Chaedie Chaedie requested a review from neverlish January 28, 2025 04:55
Copy link
Contributor

@obzva obzva left a comment

Choose a reason for hiding this comment

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

이번 주도 고생 많으셨습니다!
저번 주차 피드백까지 반영하시느라 수고하셨네요 ..
감사합니다!!


정점 V, 간선 E
Time: O(V + E)
Space: O(V + E)
Copy link
Contributor

Choose a reason for hiding this comment

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

공간 복잡도 설명을 부탁드려도 될까요? 제 생각엔 O(V)같아서요 :) 채디님 생각이 궁금합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

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

O(V) 만큼의 call stack 사용
O(E) 만큼의 oldToNew 의 value (neighbors) 저장

이라고 생각해 O(V + E) 라고 생각했습니다..!

@@ -0,0 +1,32 @@
"""
한번에 풀지 못해 다시 풀어볼 예정입니다.
Copy link
Contributor

Choose a reason for hiding this comment

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

열정..! 👍

Solution: 재귀를 활용한 풀이, memo 를 활용한 시간복잡도 개선

Time: O(m * n)
Space: O(2 * m * n)
Copy link
Contributor

Choose a reason for hiding this comment

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

일반적으로 Big-O 표기를 할 땐 상수곱을 생략합니다
O(2 * m * n) -> O(m * n)
참고: #445

Copy link
Contributor

Choose a reason for hiding this comment

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

2도 어떻게 곱하게 되신건지 여쭤볼 수 있을까요 :)

@@ -0,0 +1,25 @@
"""
Solution: 재귀를 활용한 풀이, memo 를 활용한 시간복잡도 개선
Copy link
Contributor

Choose a reason for hiding this comment

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

열정이 있으신 것 같아서 팁을 드리자면, tabulation (흔히 bottom-up라고 부르는..)을 이용하면 좀 더 공간 효율적인 풀이가 가능합니다
고민해보시거나, 이번 기수 저번 기수 다른 분들 풀이를 참고해주세요!

@@ -3,7 +3,7 @@
1) for iteration 을 도는 동안 hash set 을 이용해 처음 발견한 원소들을 window set에 넣는다.
2) 중복되는 원소를 발견할 경우 해당 원소의 중복이 사라질때까지 left side 의 원소들을 하나씩 제거한다.

Time: O(n^2) = O(n) (for iteration) * O(n) 최악의 경우 n만큼의 중복제거
Time: O(2n) = O(n) (최악의 경우 n만큼의 중복제거) * O(2) (원소당 최대 2번의 연산)
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)이라고 적어주시는게 맞을 것 같습니다

@TonyKim9401 TonyKim9401 merged commit 502e019 into DaleStudy:main Feb 2, 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