Skip to content

[ganu] Week11 #1029

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

[ganu] Week11 #1029

merged 5 commits into from
Feb 22, 2025

Conversation

gwbaik9717
Copy link
Contributor

@gwbaik9717 gwbaik9717 commented Feb 16, 2025

답안 제출 문제

체크 리스트

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

@gwbaik9717 gwbaik9717 requested a review from jdy8739 February 16, 2025 00:56
@gwbaik9717 gwbaik9717 self-assigned this Feb 16, 2025
@gwbaik9717 gwbaik9717 requested a review from a team as a code owner February 16, 2025 00:56
@github-actions github-actions bot added the js label Feb 16, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

공간 복잡도를 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(1) 이 사용되지 않을까 싶은데 어떻게 생각하시는지 궁금합니다!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제가 작성한 dfs 함수는 재귀적으로 호출되는데요, 자바스크립트에서 함수는 호출될 때마다 메모리 내 콜스택에 쌓인다고 알고 있습니다. 즉, 함수 호출회수에 비례해서 메모리 공간을 차지할 것이라 생각합니다. dfs 함수는 최대 n번 (노드의 총 개수) 만큼 반복될 것이고, 이에 따라 공간복잡도도 O(n) 을 차지할 것으로 생각하였습니다 :)

Copy link
Contributor

Choose a reason for hiding this comment

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

해당 문제는 지난번 나왔던 문제중 하나인 Reverse LinkedLIst 를 응용해서 푸는 문제라고 생각해요!
LinkedList의 특징을 살리시면 공간복잡도 O(1) 으로 풀이 하실 수 있을거에요. 도전 해 보시면 좋을것 같아요!

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주차 문제 풀이 고생하셨습니다!
Merge intervals 문제 풀이가 너무 가독성 좋고 리뷰하기 좋았던것 같아요 :)
미리 approve 해 드릴테니 남은 시간동안 LinkedList에 대해 조금 더 다가가실 수 있으면 좋을것 같습니다.
12주차 문제 풀이도 파이팅입니다!

Copy link
Contributor Author

@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.

좋은 리뷰 감사합니다! 코멘트 기반으로 반영해보겠습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

제가 작성한 dfs 함수는 재귀적으로 호출되는데요, 자바스크립트에서 함수는 호출될 때마다 메모리 내 콜스택에 쌓인다고 알고 있습니다. 즉, 함수 호출회수에 비례해서 메모리 공간을 차지할 것이라 생각합니다. dfs 함수는 최대 n번 (노드의 총 개수) 만큼 반복될 것이고, 이에 따라 공간복잡도도 O(n) 을 차지할 것으로 생각하였습니다 :)

@gwbaik9717 gwbaik9717 merged commit b5d86bb 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.

2 participants