Skip to content

Commit

Permalink
0109补充
Browse files Browse the repository at this point in the history
  • Loading branch information
yk committed Jan 16, 2024
1 parent 6cc7766 commit c890187
Show file tree
Hide file tree
Showing 3 changed files with 294 additions and 130 deletions.
3 changes: 3 additions & 0 deletions content/posts/2024/01/0104.md
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ public static int[] findTwoOdd(int[] arr) {
}
```

- 取最右边为 1 的数:`n & -n` 或者 `n & (~n + 1)`
- 消灭最右边的 1:`n & (n - 1)`,可以用来计算整数的二进制 1 的个数

## 非比较排序复习

非比较排序往往都是牺牲空间换取时间,所以通常是需要数据结构满足一定的条件下才会去使用的。
Expand Down
Loading

0 comments on commit c890187

Please sign in to comment.