38template <
class T,
class LessThan>
44 for (i = 0; i < size-1; i++){
46 for (
j = i+1;
j < size;
j++){
47 if (lt(array[
j], array[
best_i]))
53template <
class T>
static inline void selectionSort(T* array,
int size) {
56template <
class T,
class LessThan>
63 T
pivot = array[size / 2];
69 do i++;
while(lt(array[i],
pivot));
70 do j--;
while(lt(
pivot, array[
j]));
74 tmp = array[i]; array[i] = array[
j]; array[
j] =
tmp;
78 sort(&array[i], size-i, lt);
81template <
class T>
static inline void sort(T* array,
int size) {
90 sort(
static_cast<T*
>(v), v.
size(), lt); }
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
void sort(T *array, int size, LessThan lt)
void selectionSort(T *array, int size, LessThan lt)
bool operator()(T x, T y)