How to find the only Odd occurring element in Array : Bit Manipulation Interview - XOR

Опубликовано: 07 Октябрь 2024
на канале: Firmware
881
12

In this video, we will find the only number which occurs an ODD number of times in an Array using XOR manipulations in C/C++. We start with a basic example where we assume the number to find occurs only once in the array while the rest of the numbers occur an Even number of times.
The same solution can then be extended to solve our problem of finding the only number which occurs an ODD number of times in an array. A very elegant Bit Manipulation algorithm, it solidifies our concept of XOR and its commutative property.
This is a commonly asked interview question for software / firmware / embedded roles.

Must know concepts of XOR :    • Must know concepts of XOR -  Bit Mani...  
Bit Manipulation basic techniques :    • Bit Manipulation - Three most used fu...  

See Interview Preparation Series here:
   • Bit Manipulation Interview Series  

#BitManipulation #BitAlgorithms

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