It is allowed to construct the root of the van Emde Boas tree directly, without the convenience method.
Node constructor. A universe size provided, if the size is below the cutoff there is nothing to be done, as the underlying value created and set to zero by default. If otherwise create an array of children. This array has to be (according to Cormen) of size of higher square root of the current universe size + 1. The extra place is reserved for the summary. For each just created child call its constructor. For the summary with the universe size of the higher square root of the current universe size. For each other child with the universe size of the lower square root of the currennt universe size. Then, assign the fully initialized children array to the pointer in the current node, doing approprate steps to show, that this node is an intermediate node, not containing any values yet. The knowledge of the current universe size is lost at this moment. As this keeps every build up node smaller (and there could be a lot of them). This is why, the VEBtree class continues to hold the global universe size, which is passed on every call to the root node. In this way this, extern saved value has the role of being outsourced array size for each (!) node in the tree, as its size is reconstructed during the access to them.
The maximal contained key in the van Emde Boas tree
As a usual container, van Emde Boas tree provides the notion of capacity
yields a deep copy of the node. I. e. copies all data in children and allocates another tree
the empty method to inform of an empty state of the tree.
The minimal contained key in the van Emde Boas tree
The insertion method of the van Emde Boas tree.
This yields whether the node is a leaf node.
This tree has a length notion: it is the current number of inserted elements.
The successor search method of the van Emde Boas tree.
the opApply method grants the correct foreach behavior, nogc version
member method for the case universe size < base size. Overloads by passing only one parameter, which is the bit number of interest. Returns whether the appropriate bit inside the bitvector is set.
()-slicing. Yields a "random access range" with the content of the tree. Keys can be NIL.
Equality operator checks for any iterable, whether in contains the same values, as the current tree.
[]-slicing. Yields a "random access range" with the content of the tree, always containing zero and the key after the maximum element as keys. The key after the maximal key is the universe, if the tree is empty or the maximal contained key is lesser then empty, otherwise the capacity of the tree.
The predecessor search method of the van Emde Boas tree.
remove method of the van Emde Boas tree
The cached value of the universe, provided on creation
A van Emde Boas node implementation