Insertion Sort



Insertion sort is a simple algorithm with quadratic running time that builds the final sorted array one item at a time.

http://rosalind.info/problems/ins/

Given: A positive integer n≤103 and an array A[1..n] of integers.

Return: The number of swaps performed by insertion sort algorithm on A[1..n].