Skip to content

Instantly share code, notes, and snippets.

@Deathnerd
Created April 2, 2014 01:16
Show Gist options
  • Save Deathnerd/9926308 to your computer and use it in GitHub Desktop.
Save Deathnerd/9926308 to your computer and use it in GitHub Desktop.
private void selectionSort(int len) {
if(len==1)
return;
int idx=maxSub(len-1);
int t = A[idx/A.length][idx%A.length];
A[idx/A.length][idx%A.length] = A[(len-1)/A.length][(len-1)%A.length];
A[(len-1)/A.length][(len-1)%A.length] = t;
selectionSort(len-1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment