staticvoid selectsort(int[] dataset, int n)
{
int i, j;
for (i = 0; i < n; i++)
{
int min = i;
for (j = i + 1; j < n; j++)
if (dataset[j] < dataset[min])
min = j; //find min value
//then swap it with the beginning item of the unsorted list
int temp = dataset[i];
dataset[i] = dataset[min];
dataset[min] = temp;
}
}
}
}