TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Implementation Details. More...
#include <algorithm>
#include <cassert>
#include <ctime>
#include <iostream>
#include <vector>
Go to the source code of this file.
Namespaces | |
namespace | sorting |
for working with vectors | |
Functions | |
template<typename T > | |
void | sorting::quicksort (std::vector< T > *arr, int32_t low, int32_t high) |
template<typename T > | |
std::vector< T > | sorting::quicksort (std::vector< T > arr, int32_t low, int32_t high) |
static void | test_int () |
static void | test_double () |
int | main () |
Implementation Details.
Quick sort 3 works on Dutch National Flag Algorithm The major difference between simple quicksort and quick sort 3 comes in the function partition3 In quick_sort_partition3 we divide the vector/array into 3 parts. quick sort 3 works faster in some cases as compared to simple quicksort.
Definition in file quick_sort_3.cpp.
int main | ( | void | ) |
Driver program for above functions
Definition at line 184 of file quick_sort_3.cpp.
|
static |
Test function for double type arrays
Definition at line 160 of file quick_sort_3.cpp.
|
static |
Test function for integer type arrays
Definition at line 138 of file quick_sort_3.cpp.