Abstract

A simple pointer-free data structure is proposed to implement priority deques. The two heaps (a min-heap and a max-heap) of a twin-heap are stored in one linear array. The simple parent-child relationship of a traditional heap is retained. The min-heap and the max-heap will jointly grow and shrink at one end of the linear array. The proposed data structure is named a diamond deque because of the diamond shape of its Hasse diagram. Priority deque operations on a diamond deque are as efficient as on a twin-heap, a min-max heap, or a deap. Because a diamond deque is highly symmetrical, its interface relations between min-heap and max-heap are simpler. This makes it easier to implement in practice.

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.