×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

Sorting Algorithms

Sorting is an important operation as rearranging a data set optimally based on a given comparison strategy is a challenging task. The best approach depends on the characteristics of the data

Algorithms

Fibonacci Search

Fibonacci search is an efficient search algorithm based on divide and conquer principle using Fibonacci series that can find an element in the given sorted in O(log N) time complexity. It is better than Binary search as it is more cache friendly and uses only addition and subtraction operations.

Harshita Sahai Harshita Sahai
Sorting Algorithms

Comb Sort

Comb sort is a comparison based sorting algorithm and is an improvement to Bubble Sort by using the idea of killing the turtles. In Bubble Sort algorithm, the gap between the elements that are compared is always 1. Comb sort works on the same principles as Bubble Sort but uses a larger gap.

Shreya Singh
Sorting Algorithms

Heap Sort

Heapsort is an efficient in-place comparison based sorting algorithm with O(N log N) time complexity and uses a data structure to achieve it. It uses a complete Binary Heap data structure to sort the elements depending on whether the heap is Min Heap (ascending) or Max heap (descending).

P Arun Kumar P Arun Kumar
Sorting Algorithms

Radix Sort

Radix Sort is an efficient non-comparison based sorting algorithm which can sort a dataset in linear O(N) time complexity and hence, can be better than Quick Sort. It uses Counting Sort as a subroutine. It uses the fact that number of digits in an Integer is very less compared to the data

Kavita Bisht
Sorting Algorithms

Counting Sort

Counting sort is an algorithm for sorting integers in linear time. It can perform better than other efficient algorithms like Quick Sort, if the range of the input data is very small compared to the number of input data. It is a stable, non-comparison and non-recursive based sorting

Rohit Kumar Rohit Kumar
Sorting Algorithms

Bucket Sort Algorithm

Bucket sort is a comparison sort algorithm that works by distributing the elements of an array into a number of buckets and then each bucket is sorted individually using a separate sorting algorithm. It is useful when the input is uniformly distributed over a range in linear time complexity

Saranya Jena Saranya Jena
Algorithms

Maximize sum of consecutive differences in a circular array

Given an array A with values a1, a2, a3, a4, an Now, arrange all elements of array A such that sum of absolute differences of consecutive elements is maximum, i.e consider after an arrangement the array is b1, b2, b3, b4,..., bn then maximize |b1-b2| + |b2-b3| + |b3-b4| + .. + |bn-1-bn| + |bn-b1|

Piyush Mittal Piyush Mittal
linked list

Sort a Linked List which is already sorted on absolute values

Algorithm Example Complexity Implementations Questions Reading time: 15 minutes | Coding time: 5 minutes The problem at hand is to sort a singly Linked List which is already sorted on absolute value. Sorting always

OpenGenus Tech Review Team OpenGenus Tech Review Team
Sorting Algorithms

Tree sort

Tree sort is an online sorting algorithm that builds a binary search tree from the elements to be sorted, and then traverses the tree (in-order) so that the elements come out in sorted order.

Alexa Ryder Alexa Ryder
Sorting Algorithms

Shell Sort

Shellsort (also known as Shell sort or Shell's method) is an in-place comparison based sorting algorithm. Shell Sort improves its time complexity by taking the advantage of the fact that using Insertion Sort on a partially sorted array results in less number of moves.

Alexa Ryder Alexa Ryder
Sorting Algorithms

Binary Insertion Sort

Binary search is used to reduce the number of comparisons in Insertion sort. This modification is known as Binary Insertion Sort. Binary Insertion Sort use binary search to find the proper location to insert the selected item at each iteration.

Alexa Ryder Alexa Ryder
Sorting Algorithms

Insertion Sort

Insertion sort is an online stable in-place sorting algorithm that builds the final sorted list one item at a time. It works on the principle of moving a element to its correct position.

Alexa Ryder Alexa Ryder
Sorting Algorithms

Merge Sort

Algorithm Pseudocode Visual Run Complexity Implementations Applications Reading time: 20 minutes | Coding time: 10 minutes The Merge Sort is an efficient comparison based sorting algorithm based on divide and conquer strategy. It has

Alexa Ryder Alexa Ryder
Sorting Algorithms

Quick Sort

Algorithm Complexity Implementations Optimizations Applications Discussions Reading time: 20 minutes | Coding time: 10 minutes Quicksort algorithm is a comparison based sort algorithm based on Divide and Conquer strategy that is it aims to

Alexa Ryder Alexa Ryder
Sorting Algorithms

Intelligent Design Sort or Quantum BogoSort

Quantum Bogo Sort a quantum sorting algorithm which can sort any list in Θ(1), using the "many worlds" interpretation of quantum mechanics. The Many-Worlds Interpretation (MWI) of quantum mechanics holds

Alexa Ryder Alexa Ryder
Sorting Algorithms

Bogo sort

Algorithm Complexity Implementations Discussions BogoSort also known as permutation sort, stupid sort, slow sort, shotgun sort or monkey sort is a particularly ineffective algorithm based on generate and test paradigm. The algorithm successively

Alexa Ryder Alexa Ryder
Sorting Algorithms

Bead Sort: An algorithm that works faster with hardware implementation

Bead sort (gravity sort) is a natural sorting algorithm. Both digital and analog hardware implementations of bead sort can achieve a sorting time of O(n); The implementation of this algorithm tends to be significantly slower in software and can only be used to sort lists of positive integers

Alexa Ryder Alexa Ryder
Sorting Algorithms

Bubble Sort

Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in wrong order. Implementations in Java, C++, C, Go, Swift, JavaScript and many more.

Alexa Ryder Alexa Ryder
Sorting Algorithms

Selection Sort

Selection sort is a sorting algorithm sorts an array by repeatedly finding the minimum element (considering ascending order) from unsorted part and putting it at the beginning of the unsorted part. It is used when only O(N) swaps can be made and when memory write is a costly operation

Alexa Ryder Alexa Ryder
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship