Selection Sort
void SelectionSort( vector<int> &v) { for ( int i = 0, m = 0; i < v.size(); i++, m = i ) { for ( int j = i; j <v.size(); j++ ) { if ( v[j] < v[i] ) { m = j; int t = v[m]; v[m] = v[i]; v[i] = t; } } } }
void SelectionSort( vector<int> &v) { for ( int i = 0, m = 0; i < v.size(); i++, m = i ) { for ( int j = i; j <v.size(); j++ ) { if ( v[j] < v[i] ) { m = j; int t = v[m]; v[m] = v[i]; v[i] = t; } } } }