Skip to content

Instantly share code, notes, and snippets.

@anshumanatri
Created March 12, 2009 10:21
Show Gist options
  • Save anshumanatri/78011 to your computer and use it in GitHub Desktop.
Save anshumanatri/78011 to your computer and use it in GitHub Desktop.
void InsertionSort(A)
for(j = 2;j<=n;j++)
{
key = A[j];
i = j -1;
while(i > 0 && A[i] > key)
{
A[i+1] = A[i];
i = i - 1 ;
}
A[i + 1] = key;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment