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

[재호] WEEK 03 Solutions #375

Merged
merged 9 commits into from
Sep 1, 2024
Merged

[재호] WEEK 03 Solutions #375

merged 9 commits into from
Sep 1, 2024

Conversation

wogha95
Copy link
Contributor

@wogha95 wogha95 commented Aug 25, 2024

@wogha95 wogha95 added the js label Aug 25, 2024
@wogha95 wogha95 self-assigned this Aug 25, 2024
@wogha95 wogha95 marked this pull request as ready for review August 28, 2024 12:59
@wogha95 wogha95 requested a review from a team as a code owner August 28, 2024 12:59
@@ -0,0 +1,21 @@
// DP 활용하였고 메모리 축소를 위해 현재와 직전의 경우의 수만 관리하였습니다.
// TC: O(N)
// SC: 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.

공간 복잡도를 줄일 수 있는 좋은 풀이네요! 고생하셨습니다~

Copy link
Contributor

@DaleSeo DaleSeo left a comment

Choose a reason for hiding this comment

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

조금 의아한 시간 복잡도 분석이 있어서 코멘트 남겼습니다. PR 승인에는 문제가 없을 것 같습니다. 답안 빨리 제출해주셔서 감사합니다!


// 1차
// dfs를 활용하여 각 요소를 추가 -> 재귀 -> 제거로 순회합니다.
// TC: O(C^T)
Copy link
Contributor

Choose a reason for hiding this comment

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

시간 복잡도를 어떻게 O(C^T)로 분석하셨을까요? dfs() 함수 내에서 재귀 호출이 2번씩 일어나는 것 같아서 여쭙니다.

Copy link
Contributor Author

@wogha95 wogha95 Aug 31, 2024

Choose a reason for hiding this comment

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

@DaleSeo

앗, 제가 잘못 분석했습니다!
문제 풀고 알고달레 풀이 확인하면서 머리 속에 알고달레 풀이로 기억해버렸나봅니다..

다시 수정해서 TC: O(2^C)로 분석했는데 한번 확인 부탁드려도 될까요.?
(C: candidates.length)


모임에서 의견 주셔서 다시 생각해볼 수 있었습니다!
복잡도의 밑은 이해가 되지만 지수가 직관적으로 이해되지 않아서 고민해봐야겠습니다..

Copy link
Contributor

@bky373 bky373 left a comment

Choose a reason for hiding this comment

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

고생 많으셨습니다!

@wogha95 wogha95 merged commit 8cdb2dc into DaleStudy:main Sep 1, 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.

3 participants