Skip to content

Instantly share code, notes, and snippets.

/*
So we are going to implement selection sort.
In this we select smallest element and move it to the sorted subarray of the main array.
We repeat it several times until whole array is sorted.
*/
void selectionSort(int arr[], int n){
int i,j,min;
for(i=0;i<n-1i++){