parent
cc458586dd
commit
46bec1981b
@ -1,20 +0,0 @@
|
||||
void SelectionSort(int arr[], int length)
|
||||
{
|
||||
int index, temp;
|
||||
|
||||
for (int i = 0; i < length; i++)
|
||||
{
|
||||
index = i;
|
||||
for (int j = i + 1; j < length; j++)
|
||||
{
|
||||
if (arr[j] < arr[index])
|
||||
index = j;
|
||||
}
|
||||
if (index != i)
|
||||
{
|
||||
temp = arr[i];
|
||||
arr[i] = arr[index];
|
||||
arr[index] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue