Algorithm Pseudocode:
InsertionSort(A[0..n-1])
 for i=1 to n-1 do
  v=A[i]
  j=i-1
  while j>=0 and A[j]>v do
   A[j+1]=A[j]
   j=j-1
  A[j+1]=v

Insertion Sort is a sorting algorithm which repeatedly inserts each element into it proper place in the array, shifting all other elements right.