|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Demonstrates the use of Aleph's random_select algorithm. More...
#include <iostream>#include <iomanip>#include <tpl_sort_utils.H>#include <tpl_dynArray.H>#include <print_rule.H>Go to the source code of this file.
Functions | |
| template<typename Container > | |
| void | print_array (const char *label, const Container &a) |
| int | main () |
Demonstrates the use of Aleph's random_select algorithm.
This example shows how to use the iterative, 3-way partitioned Quickselect implementation provided by tpl_sort_utils.H to find the k-th smallest elements in different arrays, including calculating the median efficiently.
Definition in file random_select_example.cc.
| int main | ( | ) |
Definition at line 62 of file random_select_example.cc.
References Aleph::divide_and_conquer_partition_dp(), k, Aleph::median(), print_array(), Aleph::print_rule(), Aleph::random_select(), and Aleph::DynArray< T >::size().
Definition at line 50 of file random_select_example.cc.
Referenced by main().