-
-
Notifications
You must be signed in to change notification settings - Fork 195
[jj7779607] Week1 #637
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
[jj7779607] Week1 #637
Conversation
@DaleStudy/coach |
안녕하세요 @limlimjo 님! |
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 만큼 for문 순회하므로 -> O(n) | ||
// 공간복잡도: nums 배열 그대로 수정하여 계산 -> 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.
입력 배열을 재활용하셔서 메모리를 절약하시는 게 알고리즘 고수 같기도 하고 뭔가 멋지게 느껴집니다 😎
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.
아닙니다ㅜㅜ 완전 알고리즘 초보입니다ㅜㅜ
리뷰 감사합니다!
} | ||
|
||
nums.sort((a, b) => a - b); // 오름차순으로 정렬 | ||
console.log(nums); |
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.
console을 찍어넣고 제거를 하지 못했네요
}; | ||
|
||
// 여기서 위 코드의 시간복잡도와 공간복잡도를 생각해보자... | ||
// 시간복잡도 => O(m log m) ** 더 개선할 방법 찾아보기 |
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.
아직 못 찾아 풀이와 다른 분들의 풀이 방법을 참고하려고 합니다!
return true; | ||
} else { | ||
return true; | ||
} |
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 true; | |
} else { | |
return true; | |
} | |
} | |
return true; |
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
로 설정해주세요.