You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.1 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

## 位运算、简单排序
### 位运算
>- int左移变为2进制32位
### 逻辑运算
>- 按位与全1为1
>- 按位或有1得1
>- 异或 相同为0不同为1
### 负数取反+1
基本运算有一套底层逻辑
>>取相反数a=-b+1
### 不带符号右移>>,一般用这个
### 除2除2+1
>- a>>1
>- a>>1|1
### 几种排序的区别
>- 冒泡排序:相邻比较
>- 选择排序: 找到最值,放入位置
>- 插入排序,在已经排好的基础上继续排序
### 数组累加和
>- 建立二维数组
>- 将二维数组的值表示对应一维数组的和
>- ![img_5.png](img_5.png)
>
> -前缀和数组
> 建立一维数组,后项等于本数组前项+目标同数组下标的值
> ![img_6.png](img_6.png)
> 1~8的累加和=H[8]-H[0]
>- H[R]-H[L-1]
>- 机器人深度搜索
![img_7.png](img_7.png)
>-
>- ![img_8.png](img_8.png)
>
> ![img_9.png](img_9.png)
![img_10.png](img_10.png)
![img_11.png](img_11.png)
![img_12.png](img_12.png)
### 单链表与双链表的反转
- 利用
- pro和next临时数组改变指向
### 红黑树
![img_13.png](img_13.png)