-
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
[jdy8739] Week 10 #997
[jdy8739] Week 10 #997
Conversation
invert-binary-tree/jdy8739.js
Outdated
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.
이후 커밋에 작성되어 있습니다. 코멘트 감사합니다! :)
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.
@jdy8739 님 벌써 10주차도 마무리 하셨네요!
앞으로 남은 5주도 지금처럼 꾸준하게, 조금만 더 화이팅입니다!!
return dp[dp.length - 1]; | ||
}; | ||
|
||
// 시간복잡도 O(n2) -> nums의 길이대로 순회하면서 1부터 nums[j]의 값까지 순회하는 2중 루프를 돌기 때문 |
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.
'최대로 어디까지 점프할수 있을까?'라는 관점에서, dp 배열 대신 변수 하나만 사용하는 방법을 찾아보실 수 있지 않을까요?
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.
넵넵 풀이를 봤는데 그런 방법도 있더라고요. 다음 문제 풀이 때 적용해보도록 하겠습니다. 코멘트 감사합니다! :)
return first; | ||
}; | ||
|
||
// 시간복잡도 -> for문 이후 sort 이후 for문을 수행하며 이는 O(n) + O(nlogn) + O(n)이므로 O(nlogn)가 시간복잡도가 된다 |
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.
중요한 내용은 아닙니다!
n
을 아마 k
개 리스트 전체의 노드 수로 사용하신 것 같은데요
문제에서 k
라는 변수가 언급되어있으니, 복잡도 분석에서도 k
를 사용해 주시거나 혹은 이를 활용한 해설을 덧붙여주시는것이 좋지 않을까 싶어요!
답안 제출 문제
체크 리스트
In Review
로 설정해주세요.