This is [chapter number:: 3] Operators: & | ^ > < !
Article
Space requirements
4bit for every number
- 1
- 10
- 11
- 100
- 101
- 110
- 111
- 1000
- 1001
- 1010
A number in Javascript is 64bit so 4x16 = 64 So 16 digits must be storable, first one is signed bit, are exponents and decimal stored in different ways? How will space consumption change by that?
Problems
- Find first set bit
- Rightmost different bit
- Check whether K-th bit is set or not
- Count total set bits
- Bit Difference
- Number is sparse or not
- Longest Consecutive 1’s
- Binary To Gray Code equivalent
- Gray to Binary equivalent
- Power of 2
- Swap all odd and even bits
- Maximum AND value