nextupprevious
Next:6.1.1 Implementation of Insert and DeleteminUp:6. Priority QueuesPrevious:6. Priority Queues

6.1 Binary Heaps

Heaps (occasionally called as partially ordered trees) are a very popular data structure for implementing priority queues. REF. J.W.J. Williams. Algorithm 232: Heapsort. Communications of the ACM, Volume 7, 1964, pp 347-348

We discuss binary min-heaps. The discussion is identical for binary max-heaps.

DEF. A binary heap is a complete binary tree with elements from a partially ordered set, such that the element at every node is less than (or equal to) the element at its left child and the element at its right child. Figure 6.1 shows and example of a heap.

Figure 6.1: An example of a heap and its array representation
\begin{figure}\centerline{\psfig{figure=figures/Fheap.ps}}\end{figure}




nextupprevious
Next:6.1.1 Implementation of Insert and DeleteminUp:6. Priority QueuesPrevious:6. Priority Queues
eEL,CSA_Dept,IISc,Bangalore