How to Swap adjacent bits in a number - Bit Manipulation Firmware Interview

Опубликовано: 19 Январь 2022
на канале: Firmware
4,944
71

In this video, we learn to swap all odd and even bits of a given number using Bit Manipulation concepts in C/C++. Swapping is a useful application of bit manipulations. This problem also helps us solidify the understanding of binary right shift and binary left shift operations for bit manipulations.
This is a frequently asked interview question for software/firmware/embedded roles.

See Bit Manipulation Interview Preparation Series here:
   • Bit Manipulation Interview Series  

Find two unique numbers in Array:    • How to find two unique non-repeating ...  

Unset all bits except rightmost set bit in a number :    • How to Unset all bits except the righ...  

#BitManipulation #BitAlgorithm

You could follow us on Facebook and Instagram:
Facebook :   / firmwarecode  
Instagram :   / firmwarecode