A Worst Case Constant Time Priority Queue Ian
- Slides: 9
A Worst Case, Constant Time Priority Queue Ian Munro University of Waterloo Joint work with § Andrej Brodnik (Ljubljana & Luleå) § Svante Carlsson (Blekinge Inst. Tech. ) § Johan Karlsson (Luleå)
The Problem Ø van Emde Boas (SWAT i. e. FOCS 1975) Ø Universe integers [1, . . m] {n of which are present} Ø Operations: insert / delete find least value x (or greatest ) Ø Bound: O(lg lg m) time Ø Space: Improved to O(m) bits Ø Model: Standard RAM, with bit twiddling
Some Subsequent Work Ø Kurt Mehlhorn, Stephan Näher and Helmut Alt (Si. Comp ‘ 88): v. EB is optimal Lower bound (lg lg m) on pointer machine Ø Peter Miltersen (STOC ‘ 94): Lower bound ( lg lg m) on a RAM Ø Paul Beame and Faith Fich (STOC ‘ 99): return to parameterization by number of values actually present matching upper & lower bounds- ( lg n/ lg lg n)
Another Model: Rambo Ø Random Access Machine with Byte Overlap Mike Fredman and Dan Willard Ø Several words can share bits:
Can we do better under this model? Ø Consider elements at bottom an internal node is flagged if it has a descendant Ø lg n bit RAMBO word at leaf Can find lowest ancestor in O(1) time
The v. EB Stratified Tree Internal node keeps track of “outside” bottom elements 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
A Problem Ø Any individual leaf may be referred to by many ancestors Ø So one insertion/deletion can require up to 2 lg n reference changes Ø Modify the approach
Split Tagged Tree Keep track of left / right inside leaf … if different from parent’s Each leaf can be referred to by at most two ancestors
So what do we have? Ø Constant time “extended priority queue” … two memory accesses for search, three for update on our model Ø How much space do we need? Ø 2 m + O(lg m) bits of ordinary RAM Ø m bits of RAMBO memory in a particular configuration we call Yggdrasil Ø and it has been implemented in hardware
- Queue introduction
- Best case worst case average case
- Image search
- Bubble sort best case and worst case
- Bubble sort best case and worst case
- Bubble sort best case and worst case
- Bst worst case time complexity
- Heap sort worst case time complexity
- Worst case time complexity of linear search
- Types of priority queue