Merged
Conversation
TonyKim9401
approved these changes
Jan 30, 2025
Contributor
TonyKim9401
left a comment
There was a problem hiding this comment.
7주차 문제 풀이 고생 많으셨습니다!
문제 접근 과정과 시도 흔적 및 개선을 너무 잘 정리해주셔서 감탄하며 리뷰 진행했습니다.
8주차 문제 풀이도 파이팅입니다!
gwbaik9717
approved these changes
Jan 31, 2025
Contributor
gwbaik9717
left a comment
There was a problem hiding this comment.
안녕하세요, @Jeehay28 님! 공유해주신 코드 잘 보았습니다. 하나의 문제를 다양한 접근으로 시도해보셨다는게 굉장히 인상적이었습니다. 몇 개 없지만 코멘트 남겨두었으니 확인부탁드립니다.
| * @return {_Node} | ||
| */ | ||
|
|
||
| // BFS approach |
Contributor
There was a problem hiding this comment.
DFS 로 접근만 생각했었는데, BFS 접근도 신선하네요!
| clones.set(node, clone); | ||
| let queue = [node]; | ||
| while (queue.length > 0) { | ||
| node = queue.shift(); |
Contributor
There was a problem hiding this comment.
JS 에서 shift 연산의 시간복잡도는 O(n) 입니다. 따라서 현재 BFS 로 풀었을 때 시간 복잡도는 O(N^2 + E) 가 될 것 같은데요, shift 연산을 최적화하기 위해 Queue 를 직접 구현해보시는 것을 어떠실까요?
Contributor
Author
There was a problem hiding this comment.
아, 감사합니다. 시도해보겠습니다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
답안 제출 문제
체크 리스트
In Review로 설정해주세요.