|
Zip and Skip Tries
|
Represents a rank used in zip-zip trees, typically generated randomly for balancing. More...
#include <ZipTrie.hpp>
Public Member Functions | |
| auto | operator<=> (const GeometricRank &) const =default |
| Default comparison operator. | |
Static Public Member Functions | |
| static GeometricRank | get_random () |
| Generates a random rank using static random number generators. | |
Public Attributes | |
| uint8_t | geometric_rank |
| Rank component following a geometric distribution (primary rank). Higher values are less likely. | |
| uint8_t | uniform_rank |
| Rank component following a uniform distribution (used for tie-breaking). | |
Related Symbols | |
(Note that these are not member symbols.) | |
| std::ostream & | operator<< (std::ostream &os, const GeometricRank &rank) |
Overloaded stream insertion operator (<<) for GeometricRank. | |
Represents a rank used in zip-zip trees, typically generated randomly for balancing.
Combines a geometric and a uniform random component for tie-breaking. The geometric component helps achieve logarithmic expected depth in the zip tree/trie structure, while the uniform component ensures rank uniqueness with high probability, preventing arbitrary choices during 'zip' operations when geometric ranks are equal. This structure is crucial for maintaining the max-heap property based on ranks.
Definition at line 72 of file ZipTrie.hpp.
|
inlinestatic |
Generates a random rank using static random number generators.
The geometric component helps achieve logarithmic expected depth, while the uniform component ensures uniqueness with high probability.
Definition at line 1083 of file ZipTrie.hpp.
|
default |
Default comparison operator.
Compares geometric_rank first, then uniform_rank for tie-breaking.
|
related |
Overloaded stream insertion operator (<<) for GeometricRank.
Allows printing GeometricRank objects directly to output streams (e.g., std::cout << rank;). Formats the output as "(geometric, uniform)".
| os | The output stream (e.g., std::cout, std::ofstream). |
| rank | The GeometricRank object to print. |
Definition at line 1107 of file ZipTrie.hpp.
| uint8_t GeometricRank::geometric_rank |
Rank component following a geometric distribution (primary rank). Higher values are less likely.
Definition at line 75 of file ZipTrie.hpp.
| uint8_t GeometricRank::uniform_rank |
Rank component following a uniform distribution (used for tie-breaking).
Definition at line 77 of file ZipTrie.hpp.