Skip to content

Tag Archives: Bitwise-XOR

Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find… Read More
Given two integers a and b, how can we evaluate the sum a + b without using operators such as +, -, ++, –, …?… Read More
Prerequisite: It is recommended to refer Interesting facts about Bitwise Operators How to set a bit in the number ‘num’: If we want to set… Read More
Given two arrays that are duplicates of each other except one element, that is one element from one of the array is missing, we need… Read More
Binary Number is the default way to store numbers, but in many applications, binary numbers are difficult to use and a variety of binary numbers… Read More
Given an array arr[] of n numbers and a number K, find the number of subsets of arr[] having XOR of elements as KExamples : … Read More
Given a set of positive integers. find the maximum XOR subset value in the given set. Expected time complexity O(n). Examples: Input: set[] = {2,… Read More
We have discussed different approaches to swap two integers without the temporary variable. How to swap into a single line without using the library function?1)… Read More
The question is to find XOR of the XOR’s of all subsets. i.e if the set is {1,2,3}. All subsets are : [{1}, {2}, {3},… Read More
Given an array of integers. The task is to find the maximum subarray XOR value in the given array. Examples:  Input: arr[] = {1, 2,… Read More
Given two integers, find XOR of them without using the XOR operator, i.e., without using ^ in C/C++. Examples :   Input: x = 1, y… Read More
In C, the following 6 operators are bitwise operators (work at bit-level)   The & (bitwise AND) in C or C++ takes two numbers as operands… Read More
  Given two variables, x, and y, swap two variables without using a third variable.  Method 1 (Using Arithmetic Operators)  The idea is to get… Read More
Given two bit sequences as strings, write a function to return the addition of the two sequences. Bit strings can be of different lengths also.… Read More
  Given an array where every element occurs three times, except one element which occurs only once. Find the element that occurs once. The expected… Read More

Start Your Coding Journey Now!