Two new methods for transforming priority queues into double - ended priority queues ∗
نویسندگان
چکیده
Two new ways of transforming a priority queue into a double-ended priority queue are introduced. These methods can be used to improve all known bounds for the comparison complexity of double-ended priority-queue operations. Using an efficient priority queue, the first transformation can produce a doubleended priority queue which guarantees the worst-case cost of O(1) for find -min , find-max , and insert ; and the worst-case cost of O(lg n) including at most lgn + O(1) element comparisons for delete, but the data structure cannot support meld efficiently. Using a meldable priority queue that supports decrease efficiently, the second transformation can produce a meldable double-ended priority queue which guarantees the worst-case cost of O(1) for find-min, find -max , and insert ; the worst-case cost of O(lg n) including at most lg n+ O(lg lg n) element comparisons for delete; and the worst-case cost of O(min {lgm, lgn}) for meld . Here, m and n denote the number of elements stored in the data structures prior to the operation in question, and lg n is a shorthand for log 2 (max {2, n}).
منابع مشابه
An Efficient Construction Algorithm for a Class of Implicit Double-Ended Priority Queues
Priority queues and double-ended priority queues are fundamental data types in Computer Science, and various data structures have been proposed to implement them. In particular, diamond deques, interval heaps, min-max-pair heaps, and twin-heaps provide implicit structures for double-ended priority queues. Although these heap-like structures are essentially the same when they are presented in an...
متن کاملThe Deap-A Double-Ended Heap to Implement Double-Ended Priority Queues
A priority queue is a data type where the element with the smallest key value can be found and deleted, and new elements can be inserted. It is also called a priority queue when the element with the largest key value is wanted, instead of the smallest. In some cases, it is interesting to find and delete both the smallest and the largest element, as well as to be able to insert new elements. A s...
متن کاملA General Technique for Implementation of Efficient Priority Queues
This paper presents a very general technique for the implementation of mergeable priority queues. The amortized running time is O(log n) for DeleteMin and Delete, and (1) for all other standard operations. In particular, the operation DecreaseKey runs in amortized constant time. The worst-case running time is O(log n) or better for all operations. Several examples of mergeable priority queues a...
متن کاملOblivious Sorting and Queues
We present a deterministic oblivious LIFO (Stack), FIFO, double-ended and double-ended priority queue as well as an oblivious mergesort and quicksort algorithm. Our techniques and ideas include concatenating queues end-to-end, size balancing of multiple arrays, several multi-level partitionings of an array. Our queues are the first to enable executions of pop and push operations without any cha...
متن کامل