default constructor of a VEB tree is disabled.
to construct a VEB tree one should provide the maximum element one wish to be able to store.
another possibility is to construct a VEB tree by providing an array.
this method returns the capacity of the tree. It is equal to the next power of two with regard to the maximum element
this method is used to add an element to the tree. duplicate values will be ignored.
this method overrides the insert method to directly use arrays
this method is used to determine, whether an element is currently present in the tree
This is a nontrivial opIndex operator on indizies of the tree. Given an index a range (!) is returned, which is, either the range of elements in the tree build up by [predecessor(i) .. successor(i)] (i. e. excluding the successor(i)), when the given index is not set. Or, if the given index is set, [member(i), successor(i)]. If an index out of bounds is given, an empty array is returned. The tree must not be empty to use this function.
opSlice operator to get the underlying array. This is a draft version, as it uses the successor method of the class. So getting the underlying array is proportional to n. As this functionaly is not seen as crucial, it is enough for the first time.
opSlice operator to get the underlying array between given bounds. This is a draft version, as it uses the successor method of the class. So getting the underlying array is proportional to min(n, m), where n is the number of elements between bounds and m are the number of present elements in the tree.
this method retrieves the predecessor of the given input.
this method is used to remove elements from the tree. not existing values will be ignored.
this method retrieves the successor of the given input.
This method returns the amount of elements currently present in the tree. This is a draft version, as it uses the slice operator of the class. So getting this number has a complexity proportional to n. As this functionaly is not seen as crucial, it is enough for the first time.
this method is used to determine the maximum of the tree
this method is used to determine the minimum of the tree
This struct represents the VEB tree itself. For the sake of convinience it saves the provided at the initialization step wished maximum element. However at the point of development it is only used for testing. Beyond this, it stores only the reference to the root element, as the theory tells. The tree implements not only the documented interface of a van VEB tree, but is also a bidirectional range. It supports two slice operations and a non-trivial opIndex operator.