Given a 2D array plates[][] of size N, which each row representing the length and width of a N rectangular plates, the task is to… Read More

# Category Archives: Sorting

Given a positive integer N, the task is to count the number of integers from the range [1, N] having exactly 5 divisors. Examples: Input:… Read More

Given an array arr[] consisting of N integers, the task is to check whether it is possible to make the given array strictly increasing by… Read More

Given two arrays of strings arr[] and k[] of size N and M respectively, the task is to sort the array arr[] after replacing each… Read More

Given an array A[] of size N, the task is to sort the array in increasing order using In-Place Merge Sort. Examples: Input: A =… Read More

Given an array arr[] consisting of N pairs, where each pair represents the value and ID respectively, the task is to check if it is… Read More

Given an array arr[] consisting of N positive integers, the task is to sort the array in increasing order with respect to the count of… Read More

Given a string S consisting of N lowercase characters, the task is to find the starting and the ending indices ( 0-based indexing ) of… Read More

Preparata’s algorithm is a recursive Divide and Conquer Algorithm where the rank of each input key is computed and the keys are outputted according to… Read More

Given an integer N, representing number of projects, two arrays P[] and C[], consisting of N integers, and two integers W and K where, W… Read More

Given an array arr[] consisting of N integers and an integer K, the task is to find the maximum number of disjoint subsets that the… Read More

Prerequisite: QuickSort Algorithm The quicksort algorithm discussed in this article can take O(N2) time in the worst case. Hence, certain variations are needed which can… Read More

Given an array arr[] consisting of N positive integers, the task is to sort the array arr[] according to the increasing order of GCD of… Read More

Given two arrays arr[] and S[] consisting of N and K integers, the task is to find the maximum sum of minimum and maximum of… Read More

Given a 2D array arr[][3] consisting of information of N trains where arr[i][0] is the train number, arr[i][1] is the arrival time, and arr[i][2] is… Read More