merkel v1.0.0 Merkel.Helper

Module assists in tree creation

Link to this section Summary

Functions

Public helper to create the a balanced tree but with inner node branches alternating in random ways. Specifically if an inner node has a subtree with 3 children and another subtree with 2 children, it is randomly determined if the left child will get the subtree of 3 children and vice versa. Point being it is not set that the left child will always get the larger subtree

Public helper to create the tree with an option to specify and vary the heavier tree side when we don’t have an equal number of nodes :)

Link to this section Types

Link to this section Functions

Link to this function create_toggle_tree(list)
create_toggle_tree([pair()]) :: tuple()

Public helper to create the a balanced tree but with inner node branches alternating in random ways. Specifically if an inner node has a subtree with 3 children and another subtree with 2 children, it is randomly determined if the left child will get the subtree of 3 children and vice versa. Point being it is not set that the left child will always get the larger subtree.

Link to this function create_tree(list, toggle_acc \\ {false, false})
create_tree([pair()], tuple()) :: tuple()

Public helper to create the tree with an option to specify and vary the heavier tree side when we don’t have an equal number of nodes :)