Effective implementation of algorithms (Master Thesis)
Effective and error-free implementation of algorithms
|
Functions | |
template<typename T > | |
T | randomLevel (Rand *rand, int levelup_prob_percent, T max_level) |
T balanced_structures::skiplist::node_utils::randomLevel | ( | Rand * | rand, |
int | levelup_prob_percent, | ||
T | max_level | ||
) |
Generate level of node randomly with geometric distribution with probablity p percent. Note: The resulting distribution is geometric distribution with cutoff at max_level (higher levels are accumulated to this last)
0 < p < 100 .
rand | random number generator |
levelup_prob_percent | probability of level+1 over level |
max_level | level cutoff |