Skip to content
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

[재호] WEEK 08 Solutions #500

Merged
merged 8 commits into from
Oct 6, 2024
Merged

[재호] WEEK 08 Solutions #500

merged 8 commits into from
Oct 6, 2024

Conversation

wogha95
Copy link
Contributor

@wogha95 wogha95 commented Sep 29, 2024

답안 제출 문제

체크 리스트

  • PR을 프로젝트에 추가하고 Week를 현재 주차로 설정해주세요.
  • 바로 앞에 PR을 열어주신 분을 코드 검토자로 지정해주세요.
  • 문제를 모두 푸시면 프로젝트에서 Status를 In Review로 설정해주세요.
  • 코드 검토자 1분 이상으로부터 승인을 받으셨다면 PR을 병합해주세요.

@wogha95 wogha95 added the js label Sep 29, 2024
@wogha95 wogha95 self-assigned this Sep 29, 2024
@wogha95 wogha95 marked this pull request as ready for review October 3, 2024 08:28
@wogha95 wogha95 requested a review from a team as a code owner October 3, 2024 08:28
Copy link
Contributor

@HC-kang HC-kang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@wogha95 님 이번 한 주도 고생 많으셨습니다!
1등은 지정할 리뷰어가 없군요,, 한번 이슈업 해봐야겠네요!
마지막 15주차까지 화이팅입니다!!

memory.set(val, new _Node(val));
}

return memory.get(val);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 모든 경우를 통합 처리하는것도 좋아보입니다.
하지만 62-64라인의 케이스인 경우에는 생성한 노드를 직접 리턴해 주는 것이 메모리 접근을 줄일 수 있지 않을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

가독성 측면에서 (노드가 없으면 미리 만들고) 메모리에 있는 노드를 가져온다로 이해할 수 있도록 작성하였는데 오히려 불필요한 메모리 접근을 늘리는 것을 고려못했습니다!
리뷰 감사합니다!

*
* SC: O(1)
*
* Bit: 2진수 a 와 b 중 비트 길이가 긴 것의 비트 길이
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이 표현은 log(max(a, b)) 정도로 볼 수 있을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앗 비트 길이를 어떻게 표현할 지 고민이었는데 log로 표현할 수 있었군요.!
아이디어 감사합니다!!

@wogha95 wogha95 merged commit 76fe4b5 into DaleStudy:main Oct 6, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Completed
Development

Successfully merging this pull request may close these issues.

2 participants