van Emde Boas Trees
1. Predecessor search/ordered sets
- predecessor: return the nearest left neighbor
- successor: return the nearest right neighbor
2.Naive: O ( ∣ U ∣ ) O(|U|) O(∣U∣) space
- predecessor/successor: if x ∈ S x\in S x∈S then it’s O ( 1 ) O(1) O(1);
- insert: worst case: O ∣ U ∣ O|U| O∣U∣; compare with all elements; lucky case smaller than the min or bigger than the max.
3. Twolevel: O ( ∣ U ∣ ) O(|U|) O(∣U∣) space
- predecessor/successor: worst case: loop over the cluster of one summary, and the length of the cluster is half of the length of the original number, which is w / 2 w/2 w/2. And since for each position in the binary there could be