120unsigned long &
PRIO(
Node * p)
noexcept {
return p->getPriority(); }
143 template <
class Node>
146 if (
root == Node::NullPtr)
SentinelCtor
Tag type for sentinel node construction.
WeightedDigraph::Node Node
Data portion of a treap node.
unsigned long priority
Random priority for heap property.
void reset() noexcept
Reset (no-op for treap nodes)
TreapNode_Data() noexcept
Default constructor sets maximum priority.
TreapNode_Data(SentinelCtor) noexcept
Sentinel constructor also uses maximum priority.
unsigned long & getPriority() noexcept
Get reference to priority value.
Declare TreapNode type with 80-byte pool allocation.
__gmp_expr< T, __gmp_binary_expr< __gmp_expr< T, U >, unsigned long int, __gmp_root_function > > root(const __gmp_expr< T, U > &expr, unsigned long int l)
#define DECLARE_BINNODE_SENTINEL(Name, height, Control_Data)
Specify tree node for a binary tree.
constexpr Node *& RLINK(Node *p) noexcept
Return the right tree of p.
unsigned long & PRIO(Node *p) noexcept
Access the priority of a treap node.
constexpr Node *& LLINK(Node *p) noexcept
Return a pointer to left subtree.
Main namespace for Aleph-w library functions.
bool is_treap(Node *root) noexcept
Validate that a tree satisfies treap (heap) property.
const long Max_Priority
Maximum priority value (used for sentinel/leaves)
const long Min_Priority
Minimum priority value.
DynList< T > maps(const C &c, Op op)
Classic map operation.
Basic binary tree node definitions.