Merge sort is a divide and conquer algorithm. It is a fast, general purpose sorting algorithm.

Time complexity:

Average case : **O(n log n)**

Best case : **O(n log n)**

Worst case : **O(n log n)**

Worst case space complexity : **O(n)**

Merge sort is a divide and conquer algorithm. It is a fast, general purpose sorting algorithm.

Time complexity:

Average case : **O(n log n)**

Best case : **O(n log n)**

Worst case : **O(n log n)**

Worst case space complexity : **O(n)**

Insertion sort is an in-place sorting algorithm which builds the sorted list one item at a time.

Time complexity :

Average case : **O(n ^{2})**

Best case : **O(n)**

Worst case : **O(n ^{2})**

Worst case space complexity : **O(n)**

Selection sort is an in-place sorting algorithm.

Time complexity :

Average case : **O(n ^{2})**

Best case : **O(n ^{2})**

Worst case : **O(n ^{2})**

Worst case space complexity : **O(n)**

Quicksort is a divide and conquer algorithm. Quicksort first divides a large array into two smaller sub-arrays: the low elements and the high elements can then recursively sorts the sub-arrays.

Quicksort is considered to one of the fastest general purpose sorting algorithms even today.

Time complexity:

Average case : **n log n**

Best case : **n log n** with simple partition

Worst case : **n ^{2}**

Bubble sort is a simple sorting algorithm that repeatedly steps through the list to be sorted, compares each pair of adjacent items and swaps them if they are in the wrong order. The pass through the list is repeated until no swaps are needed, which indicates that the list is sorted.

Time complexity:

Average case : **n ^{2}**

Worst case : **n ^{2}**

Best case : **n**