# Category Archives: Sorting

Given two arrays arr[] and jump[], each of length N, where jump[i] denotes the number of indices by which the ith element in the array… Read More
Given an array arr[] consisting of N integers, the task is to find the total cost of visiting all the array elements in ascending order,… Read More
Given a matrix mat[][] of dimensions N * M, the task is to sort each column of a matrix in ascending order and print the… Read More
Sorting is an algorithm which arranges the elements of a given list in a particular order [ascending or descending]. Sorting algorithms are categorized on the… Read More
Given a string S of length N, the task is to print the highest roman number possible by rearranging the characters of the given string,… Read More
Given an array arr[] consisting of N integers and a positive integer K, the task is to check if the given array can be reduced… Read More
Given two sorted strings S1 and S2 of lengths N and M respectively, the task is to construct the lexicographically smallest string possible by merging… Read More
Given an array arr[] of size N (1 ≤ N ≤ 105), the task is to sort digits of each array element in descending order… Read More
Given an array arr[] consisting of N integers, the task is to sort the given array by using Bubble Sort without using loops. Examples: Input:… Read More
Given a string S of size N, the task is to sort the string without changing the position of vowels. Examples: Input: S = “geeksforgeeks”Output:… Read More
Given a string S consisting of N lowercase alphabets, the task is to find the length of the smallest substring in S whose occurrence is… Read More
Given a square matrix A[][] of  N * N, the task is to sort the boundary elements of a matrix starting from the outermost to the… Read More
Given an array arr[] of size N, and an integer K, the task is to count the number of pairs from the given array whose… Read More
Given an array arr[] consisting of N integers representing N transactions, the task is to merge the given lists of transactions in the order of… Read More
GUI(Graphical User Interface) helps users with better understanding programs. In this article, we will visualize Merge Sort using JavaScript. We will see how the arrays… Read More