Sorting Based Problems

Sorting-based algorithms are the ones that help in rearranging the data according to a given criterion. The contacts in your phonebook are sorted lexicographically. The cash in your wallet might be sorted in ascending or descending order. The posts on your Instagram wall are actually sorted from latest to oldest. Let’s learn about some of the most popular sorting problems to make your life and programming easier.

Longest Common Prefix Using Sorting

By Harsh Goyal

● Published At Dec 2021

This article will discuss the longest common prefix problem using the sorting approach.
... Keep reading ..

Make it Sequential

By Abhishek Ranjan

● Published At Dec 2021

In this article, we will try to solve a question on sorting algorithms that can be asked in interviews.
... Keep reading ..

Create Arithmetic progressions in the array

By Anant Dhakad

● Published At Dec 2021

Arrays and Sorting are widely asked topics in coding interviews. This article will look at a problem involving arrays and arithmetic progressions.... Keep reading ..

Creative Sorting problem

By Anant Dhakad

● Published At Dec 2021

Arrays and Sorting are widely asked topics in coding interviews. This article will look at a problem involving arrays and mergesort.... Keep reading ..

Find the Minimum Length Unsorted Subarray, Sorting Which Makes the Complete Array Sorted

By Soumya Agrawal

● Published At Jan 2022

This article will cover the implementation of the problem Find the Minimum Length Unsorted Subarray, Sorting Which Makes the Complete Array Sorted to find the minimum length unsorted array, which makes the array wholly sorted.... Keep reading ..

Maximum Gap

By Arun Nawani

● Published At Nov 2021

Our task in this problem would be to find and return the maximum Difference between any two consecutive elements in a sorted array. ... Keep reading ..

Median Again

By Soumya Agrawal

● Published At Jan 2022

This blog will cover the approach and implementation of the famous sorting problem, i.e., the Median Again.... Keep reading ..

Find The Last

By Abhishek Ranjan

● Published At Dec 2021

In this article, we will try to solve a question on sorting algorithms that can be asked in interviews.... Keep reading ..

Maximum Score Difference

By Anant Dhakad

● Published At Dec 2021

Arrays and Sorting are widely asked topics in coding interviews. This article will look at a problem involving arrays, sorting, and binary search.... Keep reading ..

Find the sum of elements less than A and greater than B in an array

By Sandeep kamila

● Published At Jan 2022

This article discusses the different approaches to finding the sum of elements less than A and greater than B in an array with examples and its C++ code.... Keep reading ..

Program to find the number of misplaced elements from the index after sorting

By Sandeep kamila

● Published At Jan 2022

This article discusses the approach to finding the number of misplaced elements from the index after sorting with its C++ code.... Keep reading ..

Smallest subarray to sort in the given array

By Yukti Kumari

● Published At Dec 2021

This article explains the various approaches to the problem of finding the smallest subarray to sort in a given array.
... Keep reading ..

Maximum Divisors in a Range

By Vibhor Bhatnagar

● Published At Dec 2021

This article will discuss the problem of finding the maximum divisors in a range.
... Keep reading ..

Maximum Sum Path

By Vibhor Bhatnagar

● Published At Dec 2021

This article will discuss the problem of finding the maximum sum path from two arrays. ... Keep reading ..

Minimum Loss

By Vaibhav Agarwal

● Published At Dec 2021

In this article, we will discuss the problem of finding the minimum loss under the given conditions.... Keep reading ..

Find the Minimum Difference Between any Two Elements

By Malay Gain

● Published At Jan 2022

In this article, we will learn to find the minimum difference between any two elements from a given array.
... Keep reading ..

Sort the Given Array after Sorting Each Number Individually

By Malay Gain

● Published At Jan 2022

In this article, we will discuss how to sort the given Array after sorting each number individually.
... Keep reading ..

Find all indices of a given element in the sorted form of the given array

By Sandeep kamila

● Published At Dec 2021

This article covers finding all indices of a given element in the sorted form of the given array.... Keep reading ..

Sort given Array using at most N cyclic shift on any subarray

By Malay Gain

● Published At Jan 2022

In this article, we will learn how to sort a given Array using at most N cyclic shift on any subarray.... Keep reading ..

Kth lexicographically smallest distinct String from given Array of Strings

By Riya

● Published At Feb 2022

This article will discuss the problem “Kth lexicographically smallest distinct string from a given array of strings”, the solution approach to this problem, its C++ implementation, and its time and space complexity.... Keep reading ..

How to sort and separate even and odd numbers in an array using a custom comparator?

By Sandeep kamila

● Published At Dec 2021

This article covers how to sort and separate the even and odd numbers in an array using a custom comparator with complete explanation and C++ code.... Keep reading ..

Minimize the number of Knapsacks with total weight W required to store Array containing elements greater than W/3

By Apoorv

● Published At Feb 2022

This article will discuss the solution of the problem “Minimize the number of Knapsacks with total weigh W required to store Array containing elements greater than W/3” along with the time complexity and space complexity of the solution... Keep reading ..

Sort a Linked List after Converting Elements to Their Squares

By Aman Chourasiya

● Published At Dec 2021

In this blog, we will discuss a coding problem based on linked lists. The problem involves applications of reversing a linked list and merging two linked lists.... Keep reading ..

Sorting by combining Insertion Sort and Merge Sort algorithms

By Vibhor Bhatnagar

● Published At Jan 2022

In this article, we will discuss a sorting algorithm that is made by combining insertion sort and merge sort.... Keep reading ..

Sort all even numbers in the Array without changing the order of odd elements

By Sandeep kamila

● Published At Dec 2021

This article covers how to sort all even numbers in the array without changing the order of odd elements with examples and code in C++.... Keep reading ..

Maximum Number of Overlapping Intervals

By aniket verma

● Published At Oct 2021

This article will brief you about finding the Maximum number of overlapping intervals.... Keep reading ..

Shortest Unsorted Continuous Subarray

By Ishita Chawla

● Published At Nov 2021

This blog will discuss three different approaches to find the length of the shortest unsorted continuous subarray.
... Keep reading ..

Non-Overlapping Intervals

By aniket verma

● Published At Nov 2021

This article will brief you on finding the number of overlapping intervals to be removed to maximize the Non-Overlapping Intervals.... Keep reading ..

Chocolate Distribution Problem

By Urwashi Priya

● Published At Nov 2021

This article will brief you on Chocolate Distribution Problem.
... Keep reading ..

Magnetic Force Between Two Balls

By Malay Gain

● Published At Nov 2021

In this article, we will learn how to solve the problem, magnetic-force-between-two-balls... Keep reading ..

Maximum Disjoint Intervals

By aniket verma

● Published At Oct 2021

This article will brief you on finding the Maximum Disjoint Intervals.
... Keep reading ..

## Top Problems related to Sorting Based Problems

MergeSort Linked List

Count Inversions

Overlapping Intervals

Alien dictionary

Number Of Pairs With Given Sum

Count Positive - Negative Pairs

MergeSort Linked List

Closest Distance Pair

Sort 0 1 2

K Most Frequent Words

Minimize The Maximum

Merge Intervals

First Missing Positive

Two Non-Repeating Elements

Distinct Left

Sorted Matrix

Lexicographical order

Minimum K product

Longest Consecutive Sequence

Football Game

Minimum Operations