81# define DIFF(p) ((p)->getDiff())
91 if (p == Node::NullPtr)
103 if (
static_cast<int>(
DIFF(p)) !=
hR -
hL)
107 if (p->getCount() !=
LLINK(p)->getCount() +
RLINK(p)->getCount() + 1)
SentinelCtor
Tag type for sentinel node construction.
#define DIFF(p)
Access the balance factor of node p.
WeightedDigraph::Node Node
AVL node data with balance factor and subtree count.
AvlNodeRk_Data(SentinelCtor) noexcept
size_t & getCount() noexcept
AvlNodeRk_Data() noexcept
signed char & getDiff() noexcept
Extended AVL node with subtree counter.
#define DECLARE_BINNODE_SENTINEL(Name, height, Control_Data)
Specify tree node for a binary tree.
size_t computeHeightRec(Node *root) noexcept
Compute recursively the height of root
Main namespace for Aleph-w library functions.
bool is_avl_rk(Node *p)
Verify if tree rooted at p is a valid AVL tree with correct counters.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
bool diff(const C1 &c1, const C2 &c2, Eq e=Eq())
Check if two containers differ.
Utility functions for binary tree operations.