Skip to content

Tag Archives: Bitwise-XOR

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 (also known as bit operators as they work at the bit-level). They are used to perform… 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
Given two signed integers, write a function that returns true if the signs of given integers are different, otherwise false. For example, the function should… Read More
In the previous post, we discussed how a Doubly Linked can be created using only one space for the address field with every node. In… Read More
Given an unsorted array that contains even number of occurrences for all numbers except two numbers. Find the two numbers which have odd occurrences in… Read More