Skip to content

Category Archives: Sorting

Radix Sort is a linear sorting algorithm that sorts elements by processing them digit by digit. It is an efficient sorting algorithm for integers or… Read More
The Time Complexity of merge sort for Best case, average case and worst case is O(N * logN). Merge Sort is a sorting algorithm that… Read More
Below are some of the most frequently asked questions on Quick Sort: 1. Hoare’s vs Lomuto Partition Please note that the above implementation is Lomuto… Read More
The average time complexity of quick sort is O(N log(N)). Quick Sort is a sorting algorithm that works using the Divide and Conquer approach. It… Read More
The Bubble Sort algorithm has a time complexity of O(N2) and a space complexity of O(1) since it does not require any additional memory space… Read More
The Selection sort algorithm has a time complexity of O(n^2) and a space complexity of O(1) since it does not require any additional memory space… Read More
Pigeonhole Sort is a simple sorting algorithm that is used to sort elements with a limited range. It is an interesting algorithm that can be… Read More
Given a permutation arr[] of size n  and a positive integer x, the task is to sort the permutation in increasing order by performing the… Read More
Given an array arr[] of integers of size n, the task is to check if we can sort the given array in non-decreasing order(i, e.arr[i]… Read More
Geek is playing a video game that contains N monsters having varying power denoted by power[i]. Geek will play total Q rounds and for each… Read More
Given an array arr[] of n integers. For each index i, you have to find the sum of all integers present in the array with… Read More
 Given Q queries in array A[][2] of three types of the form {type, X} and an empty array B[], the task for this problem is… Read More
Given a string s and an integer k, the task is to remove k characters from the string such that the sum of ASCII values… Read More
Given array A[], the task for this problem is to check whether A[] can be formed from array B[] = {1} by performing the following… Read More
Given an array arr[] of length N, the task is to find the number of subarrays that consists of prime numbers in ascending order. Examples:… Read More