This repository contains a single .py file that contains 5 basic sorting techniques
Best case : O(n)
Worst case : O(n^2)
Inefficient for Large Datasets.
Bubble sort is three times slower than QuickSort for n = 100
Worst case, Best case : O(n^2)
Inefficient for Large Datasets.
Best case : O(n)
Worst case : O(n^2)
Efficient for small datasets and partially sorted arrays.
All cases : O(n log n)
Efficient, stable, suitable for large datasets (Divide and Conquer).
Average case : O(n log n)
Worst case : O(n^2)
Efficient, widely used and reduces space usage.
All cases : O(n log n)
Efficient but not stable.
All cases : O(n + k) ; K is the range of input.
Efficient for sorting non-negative integers with a small range but requires extra memory
All cases : O(d * (n + k)) ; d โ number of digits in max number, k is range of input.
Suitable for sorting integers with fixed number of digits.
Worst case : O(n^2), but can be linear with good choice of hash func.
Efficient when data is uniformly distributed across buckets.
All cases : O(n log n)
A hybrid sorting algorithm derived from Merge sort and Insertion sort. In python it is "sorted()".