My Project
|
include all the sorting algorithms etc. More...
Functions | |
void | merge (int *arr, int lo, int mid, int hi) |
void | mergeSort (int *arr, int lo, int hi) |
void | swap (int array[], int i, int j) |
int | partition (int array[], int lo, int hi) |
partition array to to left and right, using [hi] as pivot | |
void | quickSortArr (int array[], int lo, int hi) |
include all the sorting algorithms etc.
int Algorithm::partition | ( | int | array[], |
int | lo, | ||
int | hi | ||
) |
partition array to to left and right, using [hi] as pivot
TODO: add test cases choose right most element as pivot left part <= pivot <= right part [2, 4, 1, 3] => [2, 1, 4, 3] quick sort partition