Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- selectSort(tab[], n)
- if(n == 0)
- return 0;
- minIndex;
- for(i = 0; i < n - 1; i++)
- {
- minIndex = i;
- for(j = i+1; j < n; j++)
- {
- if(tab[minIndex] > tab[j])
- {
- minIndex = j;
- }
- }
- swap(tab[minIndex], tab[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment