Radix Sort

Sorts the input data by grouping elements by shared digit position. It can be applied to integers or strings, and has a time complexity of O(d * (n + k)), where d is the maximum number of digits, n is the number of elements, and k is the radix (number of unique digits).

Insertion Sort

Builds the final sorted array one item at a time, by iterating through each item in the input data and inserting it into its proper place in the sorted list. It is efficient for small data sets or partially sorted data, but its worst-case complexity is O(n^2).

Selection Sort

Sorts by selecting the smallest item from the unsorted part of the array and placing it at the beginning of the sorted part of the array. It continues this process until the entire array is sorted. Its time complexity is O(n^2) in all cases.

Bubble Sort

Repeatedly compares adjacent elements in the array and swaps them if they are in the wrong order. It repeats this process until the entire array is sorted. Its time complexity is also O(n^2).

Merge Sort

Divides the array in half, sorts each half, and then merges them back together into a single sorted array. It has a time complexity of O(n log n), which makes it more efficient than the previous three algorithms for large data sets.

Heap Sort

Builds a binary heap from the input data and repeatedly extracts the maximum element to build the sorted array. Its time complexity is O(n log n), making it more efficient than bubble, selection, and insertion sort.

Quick Sort

Divides the array into smaller sub-arrays, recursively sorts each sub-array, and then combines them to form the final sorted array. Its time complexity is O(n log n) on average, but can degrade to O(n^2) in the worst case.

Shell Sort

Variant of insertion sort that sorts groups of elements that are far apart from each other. It reduces the number of comparisons and swaps required compared to insertion sort. Its time complexity depends on the gap sequence used, but can be as low as O(n log n).

Cocktail Sort

Bidirectional version of bubble sort that sorts in both directions, from the beginning to the end and from the end to the beginning. It has the same time complexity as bubble sort, but is more efficient in practice.

Bogo Sort

Highly inefficient and unreliable sorting algorithm that randomly shuffles the input data until it is sorted. Its time complexity is O(n!) on average, but can be infinite in the worst case. It is mainly used for educational purposes and should never be used in production code.