Find the minimum and maximum element in an array using Divide and Conquer
Given an integer array, find the minimum and maximum element present in it by making minimum comparisons by using the divide-and-conquer technique.
Ace your Coding Interview
Get hired by top tech companies with our comprehensive interview preparation.
Get StartedGiven an integer array, find the minimum and maximum element present in it by making minimum comparisons by using the divide-and-conquer technique.
Given an array where all its elements are sorted except two swapped elements, sort it in linear time. Assume there are no duplicates in the array.
Implement the Quicksort algorithm using Hoare’s Partitioning scheme which is more efficient than Lomuto’s partition scheme because it does three times fewer swaps on average, and it creates efficient partitions even when all values are equal.
This post covers a variation of counting sort that can work on negative numbers and can sort numbers in any range.
Given an unsorted integer array, find a triplet with a given sum in it.
Given an integer array having distinct elements, find the surpasser count for each element in it. In other words, for each array element, find the total number of elements to its right, which are greater than it.
Given M sorted lists of variable length, print them efficiently in sorted order.
Introsort is an efficient in-place sorting algorithm, which usually beats all other sorting algorithms in terms of performance. Due to its high performance, it is used in several standard library sort functions.
Given an integer array, find a triplet having the maximum product.
Given an integer array between 0 and 9, find two numbers with maximum sum formed using all the array digits. The difference in the number of digits of the two numbers should be ± 1.
Given an array and an integer k, find the count of distinct elements in every subarray of size k.
Given an integer array, print all maximum size subarrays having all distinct elements in them.