## Sort an array containing two types of elements

We are given an array of 0s and 1s in random order. Segregate 0s on left side and 1s on right side of the array.… Read More »

We are given an array of 0s and 1s in random order. Segregate 0s on left side and 1s on right side of the array.… Read More »

We are given an array arr[] of size n. Numbers are from 1 to (n-1) in random order. The array has only one repetitive element.… Read More »

Given an integer n and an array of size n check if it satisfies following conditions:- All elements of array must lie between 1 to… Read More »

Given an array of size n. It is also given that range of numbers is from smallestNumber to smallestNumber + n where smallestNumber is the… Read More »

Given an array A[] consisting 0s, 1s and 2s, write a function that sorts A[]. The functions should put all 0s first, then all 1s… Read More »

Sorting using trivial hash function. Examples: Input : 9 4 3 5 8 Output : 3 4 5 8 9 We have read about various… Read More »

Given an array of unique integers where each integer of the given array lies in the range [1, N]. The size of array is (N-4).… Read More »

Given an array where elements are first continuously increasing and after that its continuously decreasing unit first number is reached again. We want to add… Read More »

Given an array of size n, the goal is to find out the smallest number that is repeated exactly ‘k’ times where k > 0?… Read More »

Given a sorted array of size n and given that there are numbers from 1 to n+1 with one missing, the missing number is to… Read More »

Given an array of n unique integers where each element in the array is in range [1, n]. The array has all distinct elements and… Read More »

Given an array that contains odd number of occurrences for all numbers except for a few elements which are present even number of times. Find… Read More »

Given an array arr[0..n-1] of distinct elements and a range [low, high], find all numbers that are in range, but not in array. The missing… Read More »

Given an unsorted array of n integers which can contain integers from 1 to n. Some elements can be repeated multiple times and some other… Read More »

Given an array of integers print the missing elements that lie in range 0-99. If there are more than one missing, collate them, otherwise just… Read More »