
Pairing Heap Data Structure 419
PriorityQueue
amortized worst-case
method time complexity time complexity
get() O(1) O(1)
advance() O(1) O(n)
hasNext() O(1) O(n)
next() O(1) O(n)
retreat() O(1) O(n)
update(o), increase priority O(log n) O(1)
remove() O(log n) O(n)
update(o), decrease priority O(log n) O(n)
Table 27.6 Summary of the time complexities for the locator methods of the pairing heap tracker.
of the pairing heap. Thus, it takes constant time.
The cost for moveChildrenToQueue is proportional to the number of children since enqueue takes
constant time. Likewise, since merge takes constant time, mergeQueue takes time logarithmic in
the size of the queue ...