#include <iostream> using namespace std; /** Simple Select Sort
* brief:
* Key:
* * position: the max index
* * trip: Begin and End(:n-i)
* * swap
*
*/ template <typename T>
void simpleSelect(T* a, int n) {
T max;
int pos;
for (int i = ; i < n; i++) {
max = a[];
pos = ;
for(int j =; j < n-i; j ++) {
if(max < a[j]) {
max = a[j];
pos = j;
}
}
swap(a[pos], a[n-i-]);
}
}