-
-
Notifications
You must be signed in to change notification settings - Fork 195
[Jeehay28] WEEK 08 #960
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
[Jeehay28] WEEK 08 #960
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.
7주차 문제 풀이 고생 많으셨습니다!
문제 접근 과정과 시도 흔적 및 개선을 너무 잘 정리해주셔서 감탄하며 리뷰 진행했습니다.
8주차 문제 풀이도 파이팅입니다!
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.
안녕하세요, @Jeehay28 님! 공유해주신 코드 잘 보았습니다. 하나의 문제를 다양한 접근으로 시도해보셨다는게 굉장히 인상적이었습니다. 몇 개 없지만 코멘트 남겨두었으니 확인부탁드립니다.
* @return {_Node} | ||
*/ | ||
|
||
// BFS approach |
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 로 접근만 생각했었는데, BFS 접근도 신선하네요!
clones.set(node, clone); | ||
let queue = [node]; | ||
while (queue.length > 0) { | ||
node = queue.shift(); |
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.
JS 에서 shift
연산의 시간복잡도는 O(n)
입니다. 따라서 현재 BFS 로 풀었을 때 시간 복잡도는 O(N^2 + E)
가 될 것 같은데요, shift
연산을 최적화하기 위해 Queue 를 직접 구현해보시는 것을 어떠실까요?
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.
아, 감사합니다. 시도해보겠습니다.
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.