Proto van Emde Boas
Summarized notes on Introduction to Algorithms, Chapter 20
Structure
- universe size is
- when
it contains an array of 2 bits - when
, it contains- pointer named summary to proto-vEB(
) structure - an array named cluster of
pointers, each to proto-vEB( ) structure
- pointer named summary to proto-vEB(
is recursively stored in the structure - - cluster of some value stored in proto-vEB - - position of within its cluster used by these functions will be the universe size of the data structure in which the function is called, which changes as we descend into the recursive structure - exact location of within proto-vEB
Operations
- Min/max takes one argument, proto-vEB structure
- Other operations take two arguments:
and proto-vEB structure - Range of
is - issue: too many recursive calls
Member
- 1 recursive call: recurse until
, then return
Min/max
- 2 recursive calls:
- one to find cluster with min/max value
- one to find offset of min/max value within its cluster
Successor/predecessor
- 3 recursive calls in worst case:
- two recursive calls to self
- call to minimum
Insert
- 2 recursive calls:
- 1 to perform actual insert
- 1 to update summary bit
Delete
- no implementation given but
- recursively perform actual delete
- recursively check each cluster for members and update summary
Operation complexity
Running time | |
---|---|
member | |
minimum, maximum, insert | |
successor, predecessor |