SortAlgorithm.h
#include <vector>
= swap( &, & insertSort();
selectSort();
mergeSort();
bubbleSort();
quickSort( , );
partition( , sortSubVector( , merge( , , , < >< >
SortAlgorithm.cpp
#include <iostream><cstdlib>
#include <ctime>
#include <algorithm>
#include
= ( vectorSize > ? vectorSize : );
srand( time( ) );
( i = ; i < size; i++ + rand() % );
=( next = ; next < size; next++= moveItem =((moveItem > ) && (temp[moveItem - ] >= temp[moveItem - --= loop = size - ( i = ; i < loop; i++=( j = i + ; j < size; j++(temp[j] <=, size - comp;
swapCheck = ;
( pass = ; pass < size && swapCheck; pass++= ;
( comp = ; comp < size - pass; comp++
( temp[ comp ] > temp[ comp + + =
}
SortAlgorithm::quickSort( first, ( first >== partition( first, last );
quickSort( first, currentLocation - );
quickSort( currentLocation + , last );
}
SortAlgorithm::partition( left, position =
(
( temp[ position ] <= temp[ right ] && position !=-- ( position == ( temp[ position ] >=
( temp[ left ] <= temp[ position ] && left !=++ ( position == ( temp[ left ] >=
}
}
SortAlgorithm::sortSubVector( low, ((high - low) >= middle1 = (low + high) / middle2 = middle1 +
SortAlgorithm::merge( left, middle1, middle2, leftIndex = rightIndex = combinedIndex =<>
(leftIndex <= middle1 && rightIndex <=(temp[leftIndex] <=++] = temp[leftIndex++++] = temp[rightIndex++(leftIndex ==(rightIndex <=++] = temp[rightIndex++(leftIndex <=++] = temp[leftIndex++( i = left; i <= right; i++= SortAlgorithm::swap( &x, &===( i = ; i < size; i++<< <<((i + ) % == <<<<=
main.cpp
#include <iostream> #include << >><< << << << << , num - <<