## Sort an array using one swap

Given an array where all its elements are sorted except two elements which were swapped, sort the array in linear time. Assume there are no duplicates in the array.

Read More Sort an array using one swapCoding made easy

Given an array where all its elements are sorted except two elements which were swapped, sort the array in linear time. Assume there are no duplicates in the array.

Read More Sort an array using one swapImplement Quicksort algorithm usingĀ Hoare’s Partitioning scheme.

Read More Quick Sort using Hoare’s PartitioningĀ schemeGiven M sorted lists of variable length, print them in sorted order efficiently.

Read More Merge M sorted lists of variable lengthImplement Quicksort efficiently for inputs containing many repeated elements. Quicksort exhibits poor performance for inputs that contain many repeated elements. The problem is clearly visible when all the input elements are equal. Then at each recursion, the left partition is empty (no input values are less than the pivot), and the right partition …

Read More Quicksort using Dutch National Flag AlgorithmGiven a schedule containing arrival and departure time of trains in a station, find minimum number of platforms needed in the station so to avoid any delay in arrival of any train.

Read More Find minimum number of platforms needed in the station so to avoid any delay in arrival of any trainGiven a set of intervals, print all non-overlapping intervals after merging overlapping intervals.

Read More Merging Overlapping IntervalsGiven an array of integers, find the smallest window in array sorting which will make the entire array sorted in increasing order.

Read More Find the smallest window in array sorting which will make the entire array sortedFind largest number possible from set of given numbers. The numbers should be appended to each other in any order to form the largest number.

Read More Find largest number possible from set of given numbersGiven an array of integers, find all distinct combinations of given length where repetition of elements is allowed.

Read More Find all distinct combinations of given length with repetition allowedGiven an array of integers, find all distinct combinations of given length.

Read More Find all distinct combinations of given lengthGiven an array of integers, find maximum product of two integers in an array.

Read More Find maximum product of two integers in an arrayGiven two sorted arrays X[] and Y[] of size m and n each where m >= n and X[] has exactly n vacant cells, merge elements of Y[] in their correct position in array X[] i.e. merge (X, Y) by keeping the sorted order.

Read More Merge two arrays by satisfying given constraintsGiven two sorted arrays X[] and Y[] of size m and n each, merge elements of X[] with elements of array Y[] by maintaining the sorted order. i.e. fill X[] with first m smallest elements and fill Y[] with remaining elements. The conversion should be done in-place and without using any other data structure.

Read More Inplace merge two sorted arraysGiven an array of integers, move all zeros present in the array to the end. The solution should maintain the relative order of items in the array.

Read More Move all zeros present in the array to the end