Given a binary array arr[] of size N and some queries. Each query represents an index range [l, r]. The task is to find the xor of the elements in the given index range for each query i.e. arr[l] ^ arr[l + 1] ^ … ^ arr[r]....
Given an array a of size N. The task is to find an index ‘i’ (1 <= i <= N) such that (a[1] ^ … ^ a[i]) + (a[i+1] ^ … ^ a[N]) (x^y represents the xor value of x and y) is maximum possible....
Given an array arr[] containing 2*N+2 positive numbers, out of which 2*N numbers exist in pairs whereas the other two number occur exactly once and are distinct. Find the other two numbers. Return in increasing order....
Given an XOR linked list, the task is to delete the node at the end of the XOR Linked List....
Given two numbers say a and b. Print their XOR after making the lengths of their binary representation equal by adding trailing zeros to the binary representation of smaller one. Examples :...
A Levelwise OR/XOR alternating segment tree is a segment tree, such that at every level the operations OR and XOR alternate. In other words at Level 1 the left and right sub-trees combine together by the OR operation i.e Parent node = Left Child OR Right Child and on Level 2 the left...
Given an array of N(always a power of 2) elements and Q queries.Every query consists of two elements, an index, and a value… We need to write a program that assigns value to Aindex and prints the single element which is left after performing the below operations for each query:...
Given an array X[] of length N. Then your task is to output the minimum number of elements needed to remove so that the Bitwise XOR of any pair is either 0 or 1....
Given an array arr[] of N integers such that any two adjacent elements in the array differ at only one position in their binary representation. The task is to find whether there exists a quadruple (arr[i], arr[j], arr[k], arr[l]) such that arr[i] ^ arr[j] ^ arr[k] ^ arr[l] = 0. Here ^ denotes the bitwise xor operation and 1 ? i < j < k < l ? N.Examples:...
Given an array arr[] and two integers X and K. The task is to perform the following operation on array K times:...
Given a matrix mat[][] of size N * M, the task is to check if it is possible to rearrange the row elements of the matrix such that Bitwise XOR of the first column element is non-zero. If it is possible then print “Yes” else print “No”....
Given an array arr[] consisting of N distinct integers and queries Q[][] of the type {X, Y}, the task for each query is to find the bitwise XOR of all the array elements after replacing X by Y in the array....