Recent from talks
Knowledge base stats:
Talk channels stats:
Members stats:
Van Emde Boas tree
A van Emde Boas tree (Dutch pronunciation: [vɑn ˈɛmdə ˈboːɑs]), also known as a vEB tree or van Emde Boas priority queue, is a tree data structure which implements an associative array with m-bit integer keys. It was invented by a team led by Dutch computer scientist Peter van Emde Boas in 1975. It performs all operations in O(log m) time (assuming that an bit operation can be performed in constant time), or equivalently in time, where is the largest element that can be stored in the tree. The parameter is not to be confused with the actual number of elements stored in the tree, by which the performance of other tree data-structures is often measured.
The standard vEB tree has an unideal space efficiency of . For example, for storing 32-bit integers (i.e., when ), it requires bits of storage. To resolve this, vEB trees can be modified to achieve space, or similar data structures with equivalent asymptotic time efficiency and space efficiency of (where is the number of stored elements) can be used.
A vEB supports the operations of an ordered associative array, which includes the usual associative array operations along with two more order operations, FindNext and FindPrevious:
A vEB tree also supports the operations Minimum and Maximum, which return the minimum and maximum element stored in the tree respectively. These both run in time, since the minimum and maximum element are stored as attributes in each tree.
Let for some integer . Define . A vEB tree T over the universe has a root node that stores an array T.children of length . T.children[i] is a pointer to a vEB tree that is responsible for the values . Additionally, T stores two values T.min and T.max as well as an auxiliary vEB tree T.aux.
Data is stored in a vEB tree as follows: The smallest value currently in the tree is stored in T.min and largest value is stored in T.max. Note that T.min is not stored anywhere else in the vEB tree, while T.max is. If T is empty then we use the convention that T.max=−1 and T.min=M. Any other value is stored in the subtree T.children[i] where . The auxiliary tree T.aux keeps track of which children are non-empty, so T.aux contains the value if and only if T.children[j] is non-empty.
The operation FindNext(T, x) that searches for the successor of an element x in a vEB tree proceeds as follows: If x<T.min then the search is complete, and the answer is T.min. If x≥T.max then the next element does not exist, return M. Otherwise, let . If x < T.children[i].max, then the value being searched for is contained in T.children[i], so the search proceeds recursively in T.children[i]. Otherwise, we search for the successor of the value i in T.aux. This gives us the index j of the first subtree that contains an element larger than x. The algorithm then returns T.children[j].min. The element found on the children level needs to be composed with the high bits to form a complete next element.
Note that, in any case, the algorithm performs work and then possibly recurses on a subtree over a universe of size (an bit universe). This gives a recurrence for the running time of , which resolves to .
Hub AI
Van Emde Boas tree AI simulator
(@Van Emde Boas tree_simulator)
Van Emde Boas tree
A van Emde Boas tree (Dutch pronunciation: [vɑn ˈɛmdə ˈboːɑs]), also known as a vEB tree or van Emde Boas priority queue, is a tree data structure which implements an associative array with m-bit integer keys. It was invented by a team led by Dutch computer scientist Peter van Emde Boas in 1975. It performs all operations in O(log m) time (assuming that an bit operation can be performed in constant time), or equivalently in time, where is the largest element that can be stored in the tree. The parameter is not to be confused with the actual number of elements stored in the tree, by which the performance of other tree data-structures is often measured.
The standard vEB tree has an unideal space efficiency of . For example, for storing 32-bit integers (i.e., when ), it requires bits of storage. To resolve this, vEB trees can be modified to achieve space, or similar data structures with equivalent asymptotic time efficiency and space efficiency of (where is the number of stored elements) can be used.
A vEB supports the operations of an ordered associative array, which includes the usual associative array operations along with two more order operations, FindNext and FindPrevious:
A vEB tree also supports the operations Minimum and Maximum, which return the minimum and maximum element stored in the tree respectively. These both run in time, since the minimum and maximum element are stored as attributes in each tree.
Let for some integer . Define . A vEB tree T over the universe has a root node that stores an array T.children of length . T.children[i] is a pointer to a vEB tree that is responsible for the values . Additionally, T stores two values T.min and T.max as well as an auxiliary vEB tree T.aux.
Data is stored in a vEB tree as follows: The smallest value currently in the tree is stored in T.min and largest value is stored in T.max. Note that T.min is not stored anywhere else in the vEB tree, while T.max is. If T is empty then we use the convention that T.max=−1 and T.min=M. Any other value is stored in the subtree T.children[i] where . The auxiliary tree T.aux keeps track of which children are non-empty, so T.aux contains the value if and only if T.children[j] is non-empty.
The operation FindNext(T, x) that searches for the successor of an element x in a vEB tree proceeds as follows: If x<T.min then the search is complete, and the answer is T.min. If x≥T.max then the next element does not exist, return M. Otherwise, let . If x < T.children[i].max, then the value being searched for is contained in T.children[i], so the search proceeds recursively in T.children[i]. Otherwise, we search for the successor of the value i in T.aux. This gives us the index j of the first subtree that contains an element larger than x. The algorithm then returns T.children[j].min. The element found on the children level needs to be composed with the high bits to form a complete next element.
Note that, in any case, the algorithm performs work and then possibly recurses on a subtree over a universe of size (an bit universe). This gives a recurrence for the running time of , which resolves to .