-
Notifications
You must be signed in to change notification settings - Fork 126
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
[Tony] WEEK 12 Solutions #564
Conversation
if (p == null && q == null) return true; | ||
return false; |
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.
😉
if (p == null && q == null) return true; | |
return false; | |
return p == null && q == null; |
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.
L7 ~ L10 을 조금 더 줄여서 아래처럼 가능할 것 같습니다!
if (p == null || q == null) {
return p == q;
}
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.
정말 깔끔하게 풀어주셔서 코멘트 드릴 부분이 크게 없었네요!
한 주 동안 고생 많으셨습니다!
if (currentEnd >= nextStart) { | ||
currentInterval[1] = Math.max(currentEnd, nextEnd); |
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.
(사소) 이 조건이면 max 로 하지 않고, currentInterval[1] = currentEnd
로 해도 괜찮아 보입니다!
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.
아앗 nextStart
와 nextEnd
를 잘못 봤군요 위 내용은 넘어가시면 될 것 같습니다!
@@ -0,0 +1,17 @@ | |||
// TC: O(n) | |||
// retreive all given nodes | |||
// SC: 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 스택을 사용하는 만큼 O(N)
이지 않을까요~?
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.