Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
random_select_example.cc File Reference

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>
Include dependency graph for random_select_example.cc:

Go to the source code of this file.

Functions

template<typename Container >
void print_array (const char *label, const Container &a)
 
int main ()
 

Detailed Description

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.

Function Documentation

◆ main()

◆ print_array()

template<typename Container >
void print_array ( const char *  label,
const Container a 
)
Examples
lis_example.cc.

Definition at line 50 of file random_select_example.cc.

Referenced by main().