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 structure with these operations may be called a double-ended priority queue, or priority deque for short. A common way of implementing priority queues is through a heap-an implicit data structure first introduced by Williams (71. Some attempts to implement double-ended priority queues with heaps or heap-like structures have been made. Some examples of this are the MinMaxHeap [l] and the structure with two heaps placed ‘back-to-back’ in a suitable way, proposed by Williams. In this paper, a double-ended heap, called Deap, is presented. This structure is a mixture of the MinMaxHeap and the priority deque proposed by Williams. Also, the use of binary search of a path in a heap is used. This binary search technique is presented in [3,5]. The asymptotic results of all three implementations are the same. That is: (1) finding the largest and the smallest element takes constant time, (2) deleting the maximum or minimum element, or inserting a new element takes O(log n) time, (3) the structure can be constructed in linear time, and (4) no additional pointers are required.
منابع مشابه
Symmetric Min-Max Heap: A Simpler Data Structure for Double-Ended Priority Queue
Several data structures have been proposed to implement double-ended priority queue operations in O(log n) time, e.g., Min-Max heap [ 11, Deap [2], Diamond deque [3] and back-to-back heap [4]. In MinMax heaps, the even layers form a Min-heap and the odd layers form a Max-heap. Deap has separate Minheaps and Max-heaps that are built on the left and right subtrees, respectively. In Diamond deque,...
متن کامل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...
متن کامل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...
متن کامل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 , ...
متن کاملMin-Max Fine Heaps
In this paper we present a new data structure for double ended priority queue, called min-max fine heap, which combines the techniques used in fine heap and traditional min-max heap. The standard operations on this proposed structure are also presented, and their analysis indicates that the new structure outperforms the traditional one.
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- Inf. Process. Lett.
دوره 26 شماره
صفحات -
تاریخ انتشار 1987