Abstract

We investigate the parallel complexity of merging priority queues and double-ended priority queues (priority deques, for short). The implicit data structures that implement the queues studied in this paper are the heap, the twin-heap, the min-max heap, and the deap. It is known that heaps can be merged sequentially in sublinear time whereas merging min-max heaps requires linear sequential time. In this paper, we design efficient O(log n)-time parallel algorithms to merge two priority queue or deque structures of the same type on n and k elements (n≥k), respectively, which achieves the optimal speed-up. More precisely, two heaps of sizes n and k can be merged in O(log n) time with log k processors. Moreover, a related problem of splitting a heap on n elements into two heaps of sizes k and n−k is solved in O(log n) parallel time with log n processors, which also achieves the optimal speed-up. For the merge operation on priority deques, we show that the problem of merging twin-heaps can be solved in the same complexity as that for heaps both sequential and in parallel. Algorithms for merging two min-max heaps or two deaps of sizes n and k are demonstrated, which achieves a parallel time of O(log n) with k/log n+log k processors. The study of parallel solution to the problem of merging deaps also provides us with the first serial deap merging algorithm of time complexity O(k+log n·log k). The parallel computation model used in this paper is the EREW PRAM (Exclusive-Read Exclusive-Write Parallel Random Access Machine).

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.