Part I · Foundations, Programming and Algorithmic Thinking
6. Bit Manipulation and Binary Representation
7 lessons•46 topics•Beginner
7 of 7 lessons published
6.012 animated
Binary foundations
- Binary and hexadecimal
- Signed two's complement
- Bit positions
- Bit masks
- Binary conversion
- Fixed-width representation
6.021 animated
Bitwise operations
- AND
- OR
- XOR
- NOT
- Left shift
- Arithmetic right shift
- Logical right shift
- Operator precedence
6.032 animated
Common bit tricks
- Test bit
- Set bit
- Clear bit
- Toggle bit
- Isolate lowest set bit
- Remove lowest set bit
- Check power of two
- Count set bits
6.04Lesson
Built-in Java bit operations
- Integer.bitCount
- Integer.numberOfLeadingZeros
- Integer.numberOfTrailingZeros
- Long.bitCount
- BitSet
- rotateLeft/rotateRight
6.052 animated
XOR techniques
- XOR cancellation
- Find unique number
- Missing number
- Single Number variants
- XOR prefix
- XOR swap pitfalls
6.063 animated
Bit masks for subsets
- Represent subset
- Enumerate subsets
- Enumerate submasks
- Iterate set bits
- State transitions
- Bitmask DP introduction
6.073 animated
Advanced bit arithmetic
- Parity
- Gray code
- Bit reversal
- Carry and overflow
- Binary exponentiation
- Bitwise trie introduction