## Find a Number occurring odd number of times in a Given array

Objective: Given a array of integers, in which every elements occurs even number of times except one number which occurs add number of times. Find out that number. Example:   int[] A = { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, 7 }; Element appearing add … Read more Find a Number occurring odd number of times in a Given array

## Find a Missing Number From a Sequence of Consecutive Numbers | XOR Method

Input:  Array, arrA[] with a miss­ing num­ber and Range

Out­put : miss­ing number

Example:

```int A[] = { 1, 2, 7, 6, 3, 4 };
int range = 7;
Output: MIssing No is :5```

In our earlier approach ” Click Here ” we have seen the method where we had calculated the Sum of numbers, but this approach might fail when number goes beyond the integer range.

XOR method will better solution in that case.

Approach: – Time Complexity -O(N), Space Complexity – O(1)

Read moreFind a Missing Number From a Sequence of Consecutive Numbers | XOR Method

## Generate All Strings of n bits.

Objec­tive: Generate All Strings of n bits, consider A[0..n-1] is an array of size n.

Example :

```n = 3
Output:
[0, 0, 0]    [1, 0, 0]    [0, 1, 0]    [1, 1, 0]

[0, 0, 1]     [1, 0, 1]     [0, 1, 1]    [1, 1, 1]
```

Read moreGenerate All Strings of n bits.

## Find The Missing Duplicate in a Given Array.

Objec­tive: Given an Integer array. Array contains duplicates of all the numbers in array except one number . Find that number.

Example :

```int [] A = { 2,1,3,5,5,3,2,1,6,7,7,8,8};
Output : Missing duplicate is 6
```

Read moreFind The Missing Duplicate in a Given Array.

## Reverse the binary representation of a number.

Objective: Write a program to Reverse the binary representation of a number

Example:

```Input : 30
Output : 15

Explanation:

binary representation of 30 is : 11110
reverse of binary representation : 01111
decimal of reversed binary representation is : 15
```

Input: A Number

Output: Decimal of reversed binary representation of a number.

Approach:

Read moreReverse the binary representation of a number.