Query of largest element in a set less than an element
In
balanced binary search trees, van Emde Boas trees, and fusion trees. In the static predecessor problem, the set of elements does not change, but in the dynamic predecessor problem, insertions into and deletions from the set are allowed.[1]
The predecessor problem is a simple case of the nearest neighbor problem, and data structures that solve it have applications in problems like integer sorting.
Definition
The problem consists of maintaining a set S, which contains a subset of U integers. Each of these
word size
of w, implying that . Data structures that solve the problem support these operations:[2]
predecessor(x), which returns the largest element in S less than or equal to x
successor(x), which returns the smallest element in S greater than or equal to x
In addition, data structures which solve the dynamic version of the problem also support these operations:
of for predecessor queries. The Van Emde Boas tree achieves a query time of , but requires space.[1]Dan Willard proposed an improvement on this space usage with the x-fast trie, which requires space and the same query time, and the more complicated y-fast trie, which only requires space.[3]Fusion trees, introduced by Michael Fredman and Willard, achieve query time and for predecessor queries for the static problem.[4] The dynamic problem has been solved using exponential trees with query time,
) , and similarly, for all values of n, there exists a value of n such that the query time is .[1] Other proofs of lower bounds include the notion of communication complexity.