Day-2: Insertion Sort

Day-2: Insertion Sort

Insertion sort algorithm is a sorting algorithm that is desirable when the data size is relatively smaller or nearly sorted.

Insertion sort starts with a pointer that assumes the first element as a sorted subarray of the original array. The pointer moves on and in every iteration; places the new element in its correct place in the sorted subarray.

The sorted subarray grows and at the end, the array is sorted.

Time complexity: O(n^2)

Here is the link of my C++ implementation of Insertion Sort: Insertion Sort

Author face

Abdurrezzak Efe

Bilkent University Bachelor's in CS 2018'

Recent post