Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions reverse-bits/soobing.ts
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🏷️ 알고리즘 패턴 분석

  • 패턴: Bit Manipulation
  • 설명: 이 코드는 비트 연산을 이용하여 32비트 정수의 비트 순서를 뒤집는 방식으로, 비트 조작을 핵심으로 하는 패턴에 속합니다.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
* >>>, >>, <<, &, |
* - signed, unsigned 연산
*/

// test2
function reverseBits(n: number): number {
let result = 0;

for (let i = 0; i < 32; i++) {
result <<= 1;
result |= n & 1;
Expand Down
Loading