Turn off the rightmost set bit
Turn off the rightmost set bit - Bit Algorithm - Let the input number be n. n-1 would have all the bits flipped after the...
Turn off the rightmost set bit - Bit Algorithm - Let the input number be n. n-1 would have all the bits flipped after the...
Multiply a given Integer with 3.5 - Bit Algorithm - Given a integer x, write a function that multiplies x with 3.5 and...
Add 1 to a given number - Bit Algorithm - Add 1 to a given number write a program to add 1 to a given number. You are not...
Optimization Techniques | Set 1 (Modulus) - Bit Algorithm - The modulus operator (%) in various languages is costly...
Next higher number with same number of set bits - Bit Algorithm - When we observe the binary sequence from 0 to 2n – 1 (n is...
Program to count number of set bits in an (big) array- Bit Algorithm - The simple approach would be, create an efficient...
A Boolean Array Puzzle - Bit Algorithm - Following are the specifications to follow. It is guaranteed that one element is 0...
Smallest of three integers without comparison - Bit Algorithm - Take a counter variable c and initialize 0. In a loop,...
Add two numbers without using arithmetic operators - Bit Algorithm - Sum of two bits can be obtained by performing XOR (^)...
Swap bits in a given number - Bit Algorithm - Given a number x and two positions (from right side) in binary representation...
Our site uses cookies. By using this site, you agree to the Privacy Policy and Terms of Use.