Given an array arr[] of N elements ranging from 0 to N-1(both included), the task is to rearrange the array such that the sum of… Read More

# Category Archives: Sorting

Given a string S consisting of lower case letters and an integer K, the task is to remove minimum number of letters from the string,… Read More

Given an integer array A[] of size N, the task is to check if the array can be divided into two subsequences such that appending… Read More

There have always been arguments about how can be a sorting algorithm of linear time complexity be achieved, as all the traditional sorting algorithms are… Read More

In certain sorting problems, if the data is already sorted the complexity of the sorting algorithm changes. That is it can be said that the… Read More

Given a positive integer N, the task is to find the largest possible value of N after any number of swaps is made between digits… Read More

Given N tasks and N people who can work on them. Each task requires A[i] (0 <= i <= N-1) units of work to complete… Read More

Given an array arr[] of size N, the task is to find the last element remaining after removing all elements closest to sum/2 sequentially where… Read More

Given two arrays arr1[] and arr2[] of length N each and an integer K, The task is to maximize the number of equal elements at… Read More

Given a string S and a list of strings subs[] that stores the substrings of S and all the substrings are present only once, the… Read More

Sorting algorithms are the means to sort a given set of data in an order according to the requirement of the user. They are primarily… Read More

Circularly sorted arrays are arrays that are sorted in ascending or descending order and then rotated by a number of steps. Let us take an… Read More

Given an array arr[] of size N, the task is to find the maximum value that can be obtained by following the below conditions: Select… Read More

Given an array arr[] of size N and a positive integer K, the task is to check if the array can be reordered such that… Read More

Given two arrays A[] and B[] (B[i] < A[i]) of size N each and an integer K, the task is to perform the operation of… Read More