## XOR Linked List – A Memory Efficient Doubly Linked List | Set 2

In the previous post, we discussed how a Doubly Linked can be created using only one space for address field with every node. In this… Read More »

- Sum of XOR of all subarrays
- Find elements of array using XOR of consecutive elements
- Convert Singly Linked List to XOR Linked List
- XOR of all the elements in the given range [L, R]
- XOR of XORs of all sub-matrices
- Check whether XOR of all numbers in a given range is even or odd
- Number of subarrays such that XOR of one half is equal to the other
- Range Queries to Find number of sub-arrays with a given xor
- Count of values of x <= n for which (n XOR x) = (n - x)
- Print steps to make a number in form of 2^X - 1
- Count no. of ordered subsets having a particular XOR value
- Minimizing array sum by applying XOR operation on all elements of the array
- Choose X such that (A xor X) + (B xor X) is minimized
- Find array using different XORs of elements in groups of size 4
- Sum of XOR of all sub-arrays of length K
- Find a number which give minimum sum when XOR with every number of array of integers
- Check if a number from every row can be selected such that xor of the numbers is greater than zero
- Count of sub-arrays whose elements can be re-arranged to form palindromes
- Create a sequence whose XOR of elements is y
- Convert given integer X to the form 2^N - 1
- Find the node whose xor with x gives minimum value
- Pairs from an array that satisfy the given condition
- Generate all binary strings of length n with sub-string "01" appearing exactly twice
- All pairs whose xor gives unique prime
- Total pairs in an array such that the bitwise AND, bitwise OR and bitwise XOR of LSB is 1
- Composite XOR and Coprime AND
- Number of ways for playing first move optimally in a NIM game
- Find a sub matrix with maximum XOR
- XOR of all the nodes in the sub-tree of the given node
- Find the node whose xor with x gives maximum value

In the previous post, we discussed how a Doubly Linked can be created using only one space for address field with every node. In this… 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 »

Given a number x and two positions (from right side) in binary representation of x, write a function that swaps n bits at given two… Read More »

Write a function Add() that returns sum of two integers. The function should not use any of the arithmetic operators (+, ++, –, -, ..… Read More »

Given an unsorted array of size n. Array elements are in the range from 1 to n. One number from set {1, 2, …n} is… Read More »

An ordinary Doubly Linked List requires space for two address fields to store the addresses of previous and next nodes. A memory efficient version of… Read More »

How to swap two variables? The question may look silly, neither geeky. See the following piece of code to swap two integers (XOR swapping), void… Read More »

On some rare machines where branching is expensive, the below obvious approach to find minimum can be slow as it uses branching. filter_none edit close… Read More »

Asked by SG Given an array in which all numbers except two are repeated once. (i.e. we have 2n+2 numbers and n numbers are occurring… Read More »

Given two numbers ‘a’ and b’. Write a program to count number of bits needed to be flipped to convert ‘a’ to ‘b’. Example :… Read More »

Asked by Varun Bhatia. Question: Write a code for implementation of doubly linked list with use of single pointer in each node. Solution: This question… Read More »

You are given a list of n-1 integers and these integers are in the range of 1 to n. There are no duplicates in the… Read More »

Given an array of positive integers. All numbers occur even number of times except one number which occurs odd number of times. Find the number… Read More »