Insertion sort is a sorting algorithm in O(n2) time. It basically inserts each item into its correct position.