-
-
Notifications
You must be signed in to change notification settings - Fork 195
[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
[ganu] Week11 #1029
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.
공간 복잡도를 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(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.
제가 작성한 dfs
함수는 재귀적으로 호출되는데요, 자바스크립트에서 함수는 호출될 때마다 메모리 내 콜스택에 쌓인다고 알고 있습니다. 즉, 함수 호출회수에 비례해서 메모리 공간을 차지할 것이라 생각합니다. dfs
함수는 최대 n번 (노드의 총 개수) 만큼 반복될 것이고, 이에 따라 공간복잡도도 O(n) 을 차지할 것으로 생각하였습니다 :)
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.
해당 문제는 지난번 나왔던 문제중 하나인 Reverse LinkedLIst 를 응용해서 푸는 문제라고 생각해요!
LinkedList의 특징을 살리시면 공간복잡도 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.
11주차 문제 풀이 고생하셨습니다!
Merge intervals 문제 풀이가 너무 가독성 좋고 리뷰하기 좋았던것 같아요 :)
미리 approve 해 드릴테니 남은 시간동안 LinkedList에 대해 조금 더 다가가실 수 있으면 좋을것 같습니다.
12주차 문제 풀이도 파이팅입니다!
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.
제가 작성한 dfs
함수는 재귀적으로 호출되는데요, 자바스크립트에서 함수는 호출될 때마다 메모리 내 콜스택에 쌓인다고 알고 있습니다. 즉, 함수 호출회수에 비례해서 메모리 공간을 차지할 것이라 생각합니다. dfs
함수는 최대 n번 (노드의 총 개수) 만큼 반복될 것이고, 이에 따라 공간복잡도도 O(n) 을 차지할 것으로 생각하였습니다 :)
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.