Created
May 20, 2010 07:05
-
-
Save djg/407290 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void sort2(int* A, int n) | |
{ | |
for (int i = 0; i < n; ++i) | |
{ | |
int min = i; | |
for (int j = i+1; j < n; ++j) | |
{ | |
if (A[j] < A[min]) | |
min = j; | |
} | |
int tmp = A[i]; | |
A[i] = A[min]; | |
A[min] = tmp; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment