Skip to content

Tag Archives: Bitwise-XOR

Given an unsorted array of size n. Array elements are in the range of 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. It is represented as follows… 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. C++ /* The… 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 twice… Read More
Given two numbers A and B. Write a program to count the number of bits needed to be flipped to convert A to B.  Examples: … 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
Given an array arr[] of size N-1 with integers in the range of [1, N], the task is to find the missing number from the… Read More
Given an array arr[] consisting of positive integers that occur even number of times, except one number, which occurs odd number of times. The task… Read More
Given an array of positive integers. All numbers occur an even number of times except one number which occurs an odd number of times. Find… Read More

Start Your Coding Journey Now!