Skip to content

Instantly share code, notes, and snippets.

@Roconda
Created February 9, 2013 12:53
Show Gist options
  • Save Roconda/4745216 to your computer and use it in GitHub Desktop.
Save Roconda/4745216 to your computer and use it in GitHub Desktop.
reversed selectionsort
public void SelectionSort()
{
int HuidigePositie, HuidigeWaarde;
for (int I = 0 ; I < collection.Length - 1 ; I++)
{
HuidigePositie = I;
HuidigeWaarde = collection[I];
for (int J = collection.Length-1 ; J > I ; J--)
{
if (collection[J] < HuidigeWaarde)
{
HuidigePositie = J;
HuidigeWaarde = collection[J];
}
}
collection[HuidigePositie] = collection[I];
collection[I] = HuidigeWaarde;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment