a. Describe the concept of a Binary heap and the heap order property. [10 marks]
b. Explain the use of the binary heap as an effective implementation for a priority queue [10 MARKS]
a.
A binary heap is a complete binary tree which satisfies the heap ordering property. The ordering can be one of two types:
b.
The binary heap is a data structure that can efficiently support the basic priority-queue operations. In a binary heap, the items are stored in an array such that each key is guaranteed to be larger than (or equal to) the keys at two other specific positions.
Comments