Comparison Between different Sorting Algorithms

Here we will see some sorting methods. There are 200+ sorting techniques. We will see few of them. Some sorting techniques are comparison based sort, some are non-comparison based sorting technique.

Comparison Based Soring techniques are bubble sort, selection sort, insertion sort, Merge sort, quicksort, heap sort etc. These techniques are considered as comparison based sort because in these techniques the values are compared, and placed into sorted position in ifferent phases. Here we will see time complexity of these techniques.

Analysis Type Bubble Sort Selection Sort Insertion Sort Merge Sort Quick Sort Heap Sort
Best Case O(n2) O(n2) O(n) O(log n) O(log n) O(logn)
Average Case O(n2) O(n2) O(n2) O(log n) O(log n) O(log n)
Worst Case O(n2) O(n2) O(n2) O(log n) O(n2) O(log n)
2 Likes