Explain the methodologies of various type that can be used to manipulate bits in register. Elaborate with proper examples.
The following methods can be used to conduct bit manipulation:
1. Print numbers having first and last bits as the only set bits. ...
2. Check if all bits can be made same by flipping two consecutive bits. ...
3. Flip bits of the sum of count of set bits of two given numbers. ...
4. Count of pairs {X, Y} from an array such that sum of count of set bits in X ⊕ Y and twice the count of set bits in X & Y is M.
Comments
Leave a comment