|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Four creative scenarios demonstrating Mo's algorithm. More...
#include <tpl_mo_algorithm.H>#include <tpl_dynMapOhash.H>#include <tpl_dynSetHash.H>#include <algorithm>#include <cassert>#include <cstdio>Go to the source code of this file.
Classes | |
| struct | Packet_Sum_Sq_Policy |
| Custom Mo policy: sum of squared packet sizes in a window. More... | |
Functions | |
| static void | biodiversity_survey () |
| static void | powerful_array () |
| static void | election_polling () |
| static void | network_packet_analysis () |
| int | main () |
Four creative scenarios demonstrating Mo's algorithm.
Count distinct species observed by a wildlife camera trap across different time windows. Uses Distinct_Count_Mo.
Classic competitive programming problem: compute sum(cnt[x]^2 * x) for several ranges. Uses Powerful_Array_Mo.
Find the most reported candidate (mode) across polling windows. Uses Range_Mode_Mo.
Sum of squared packet sizes in time windows. Demonstrates writing a custom MoPolicy from scratch.
Definition in file mo_algorithm_example.cc.
|
static |
Definition at line 71 of file mo_algorithm_example.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::DynHashTable< Key, HashTable, Cmp >::insert(), l, and r.
Referenced by main().
|
static |
Definition at line 166 of file mo_algorithm_example.cc.
References Aleph::divide_and_conquer_partition_dp(), l, and r.
Referenced by main().
| int main | ( | ) |
Definition at line 298 of file mo_algorithm_example.cc.
References biodiversity_survey(), Aleph::divide_and_conquer_partition_dp(), election_polling(), network_packet_analysis(), and powerful_array().
|
static |
Definition at line 245 of file mo_algorithm_example.cc.
References Aleph::divide_and_conquer_partition_dp(), l, and r.
Referenced by main().
|
static |
Definition at line 126 of file mo_algorithm_example.cc.
References Aleph::divide_and_conquer_partition_dp().
Referenced by main().