Bit Manipulation
The number of questions on bit manipulation in coding interviews is relatively low. However, it is essential to understand the basics of bit manipulation to solve these questions. This section will cover the basics of bit manipulation and provide solutions to common bit manipulation questions.
Table of Contents
Question | Difficulty | Solution |
---|---|---|
Swap Two Numbers | Basic | Solution |
Set ith bit | Basic | Solution |
Check if K-th bit | Basic | Solution |
Clear the K-th bit | Basic | Solution |
Toogle the K-th bit | Basic | Solution |
Turn off the rightmost set bit | Basic | Solution |