Van Emde Boas priority queue

from Wikipedia, the free encyclopedia

In computer science , the Van Emde Boas priority queue , which is named after its inventor Peter van Emde Boas , is an efficient implementation of a priority queue in which the actions insert, delete, GetMinimum etc. have a running time of O (log log N) where N is the number of possible keys.

construction

A Van Emde Boas priority queue consists of a k-structure T, where k indicates the maximum number of bits that each element may need for representation, with the following properties:

  • T.size: Number of all elements that are currently stored in the priority queue
  • T.list: Doubly linked list that contains the stored keys in ascending order
  • Tb: a bit vector with Tb [i] =
  • Tp: A vector of pointers to the elements of T.list. If Tb [i] = 1, then Tp [i] points to i in T.list.
  • T.top: The same k / 2 structure described here, which contains the first half of the bits of all keys contained in T.list
  • T.bottom: A field with k / 2 structures, each of which contains an entry for the elements of T.top, with the content of the last half of the bits belonging to the front half.

example

Be the key set .

  • Then T.size
  • T.list contains the keys from S doubly concatenated in ascending order.
  • Tb [2] Tb [3] Tb [7] Tb [10] Tb [13] .
  • Tp [2] points to in T.list, Tp [3] to etc.

For T.top and T.bottom, the binary values ​​of the stored numbers must be considered. , , , , .

  • T.top is 2-structure for the values .
  • T.bottom has 4 entries (one for each element from T.top) with
    • T.bottom [0] ,
    • T.bottom [1] ,
    • T.bottom [2] ,
    • T.bottom [3] .

A key with cannot be saved in this 4-structure, since more than 4 bits would be required for storage.

literature

  • P. van Emde-Boas, R. Kass, E. Zijlstra: Design and Implementation of an Efficient Priority Queue. In: Mathematical Systems Theory. 10: 99-127, 1977.
  • P. van Emde-Boas: Preserving Order in a Forest in Less than Logarithmic Time and Linear Space. In: Inf. Proc. Letters. 6 (3): 80-82, June 1977.