## Merge sort

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

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

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

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}**