Bit Manipulation
题目列表
XOR
- Single Number
- Single Number II
- Single Number III
- Missing Number
&
- Number of 1 Bits
- Power of Two
Shift
- Reverse Bits
- Reverse Integer
- Divide 2 Integers
Math
- Repeated DNA Sequence
Bitwise AND of Numbers Range
问题描述
这类题目都涉及到bit的基本操作
&|^~- shift
>>and<<
math中的mathwithoutOperator也往往是使用bit manipulation:
- 乘法,除法 -
shft 加法,减法 -
^得到carry,^的到sum, carry再shiftReference