merkel v1.0.5 Merkel.AVL
Implements the AVL balance rotations for a binary tree A self-balancing AVL tree ensures the tree height is always O(log n)
Link to this section Summary
Functions
Balances tree rooted at node n using avl rotations. Runs the update callback function for each node that is affected by rotations
Checks whether the tree rooted at node n needs to be balanced
Link to this section Types
Link to this section Functions
Link to this function
balance(node, s_key, fn_update)
balance(Merkel.BinaryNode.t(), skey(), function()) :: Merkel.BinaryNode.t()
Balances tree rooted at node n using avl rotations. Runs the update callback function for each node that is affected by rotations
Checks whether the tree rooted at node n needs to be balanced