Classification of sorting algorithms

Pseudo
Jul 12, 2021

Each sorting algorithm has its own pros and cons. This article classifies sorting algorithms into 5 category which will help you decide the best fit for your own use case.

List of sorting algorithms:

  1. Bubble Sort
  2. Quick Sort
  3. Insertion Sort
  4. Merge Sort
  5. Selection Sort
  6. Heap Sort
  7. Counting Sort
  8. Radix Sort

Classifications

Time complexity

Space complexity: In-place (constant space) v/s memory usage increase with input size

Recursive v/s Non-recursive

Stability: stable sort v/s unstable sort

Stable sorting algorithms preserve the relative order of equal elements, while unstable sorting algorithms don’t

Memory/Disk storage: Internal sort v/s External sort. If RAM or memory is used to store all records then it is internal sort. If records are on disk/tapes then it is external sort.

--

--

Pseudo

Hey all! I’m here to share experiences and the best of my learnings with you. Drop a mail at spseudo001@gmail.com