-
-
Notifications
You must be signed in to change notification settings - Fork 247
[grapefruitgreentealoe] WEEK 04 Solutions #1818
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
[grapefruitgreentealoe] WEEK 04 Solutions #1818
Conversation
let right = nums.length - 1; | ||
|
||
while (left !== right) { | ||
let mid = Math.floor((left + right) / 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.
Binary Search에서 흔히 사용하는 식이네요!
해당 식과 관련하여 공유드리고 싶은 정보가 있어서 디스코드로 공유해 둘께요 :)
시간 복잡도: O(log n) | ||
공간 복잡도: O(h) |
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.
LinkedList의 정렬을 위해서는 각 list1, list2의 모든 요소를 순회해야 하고, 따로 메모리를 사용하지 않으신것 같은데 시간 복잡도 O(m+n), m은 list1의 길이, n은 list2의 길이 / 공간 복잡도 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.
문제들을 엄청 꼼꼼하게 풀어주셔서 고민을 많이 하신게 보이네요.
부족하지만 코드 리뷰가 도움이 되셨으면 좋겠습니다.
4주차 문제 풀이 고생하셨습니다!
답안 제출 문제
작성자 체크 리스트
In Review
로 설정해주세요.검토자 체크 리스트
Important
본인 답안 제출 뿐만 아니라 다른 분 PR 하나 이상을 반드시 검토를 해주셔야 합니다!