FindNext
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 i=x/M1/2. If x≤T.children.max then the value being searched for is contained in T.children so the search proceeds recursively in T.children. Otherwise, We search for 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.min. The element found on the children level needs to be composed with the high bits to form a complete next element.
function FindNext(T, x) if x ≤ T.min then return T.min if x > T.max then // no next element return M i = floor(x/) lo = x % hi = x - lo if lo ≤ T.children.max then return hi + FindNext(T.children, lo) return hi + T.children.min endNote that, in any case, the algorithm performs O(1) work and then possibly recurses on a subtree over a universe of size M1/2 (an m/2 bit universe). This gives a recurrence for the running time of T(m)=T(m/2) + O(1), which resolves to O(log m) = O(log log M).
Read more about this topic: Van Emde Boas Tree, How It Works