DEV Community 👩‍💻👨‍💻

DEV Community 👩‍💻👨‍💻 is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cover image for Sorting Algorithms
Pritesh Bhoi
Pritesh Bhoi

Posted on • Originally published at

Sorting Algorithms

A sorting algorithm is used to rearrange a given array or list elements according to a comparison operator on the elements. The comparison operator decides on the new order of the elements in the respective data structure.

For example, the following list of characters is sorted in ascending order of their ASCII values. That is, the character with a lower ASCII value is placed before the character with a higher ASCII value.

Basic Sorting Algorithms:

  • 1. Sorting Terminology
  • 2. Stability in sorting algorithms
  • 3. Time complexities of Standard Sorting Algorithms
  • 4. External Sorting

Sorting Algorithms :

  • Selection Sort
  • Bubble Sort
  • Recursive Bubble Sort
  • Insertion Sort
  • Recursive Insertion Sort
  • Merge Sort
  • Iterative Merge Sort
  • Quick Sort
  • Iterative Quick Sort
  • Heap Sort
  • Counting Sort
  • Radix Sort
  • Bucket Sort
  • ShellSort
  • TimSort
  • Comb Sort
  • Pigeonhole Sort
  • Cycle Sort
  • Cocktail Sort
  • Strand Sort
  • Bitonic Sort
  • Pancake sorting
  • Binary Insertion Sort
  • BogoSort or Permutation Sort
  • Gnome Sort
  • Sleep Sort – The King of Laziness / Sorting while Sleeping
  • Structure Sorting (By Multiple Rules) in C++
  • Stooge Sort
  • Tag Sort (To get both sorted and original)
  • Tree Sort
  • Cartesian Tree Sorting
  • Odd-Even Sort / Brick Sort
  • QuickSort on Singly Linked List
  • QuickSort on Doubly Linked List
  • 3-Way QuickSort (Dutch National Flag)
  • Merge Sort for Linked Lists
  • Merge Sort for Doubly Linked List
  • 3-way Merge Sort

Library Implementations of Sorting Algorithms:

  1. Know Your Sorting Algorithm | Set 1 (Sorting Weapons used by Programming Languages)
  2. Know Your Sorting Algorithm | Set 2 (Introsort- C++’s Sorting Weapon)
  3. Comparator function of qsort() in C
  4. sort() in C++ STL
  5. C qsort() vs C++ sort()
  6. Arrays.sort() in Java with examples
  7. Collections.sort() in Java with Examples

If you like and want to contribute, you can also write an article and email it to Check out this article on’s main page and help other developers. Write comments if you find something wrong or want to share more information on the topic discussed above.

Top comments (0)

🌚 Friends don't let friends browse without dark mode.

Sorry, it's true.