analysis of heap-based priority queue table shows the running time of the priority queue adt methods for the heap implementation of priority queueassuming that two keys can be compared in ( time and that the heap is implemented with an array-based or linked-based tree representation in shorteach of the priority queue adt methods can be performed in ( or in (log ntimewhere is the number of entries at the time the method is executed the analysis of the running time of the methods is based on the followingthe heap has nodeseach storing reference to key-value pair the height of heap is (log )since is complete (proposition the min operation runs in ( because the root of the tree contains such an element locating the last position of heapas required for add and remove mincan be performed in ( time for an array-based representationor (log ntime for linked-tree representation (see exercise - in the worst caseup-heap and down-heap bubbling perform number of swaps equal to the height of operation len( ) is emptyp minp addp remove minamortizedif array-based running time ( ( (log ) (log )table performance of priority queueprealized by means of heap we let denote the number of entries in the priority queue at the time an operation is executed the space requirement is (nthe running time of operations min and remove min are amortized for an array-based representationdue to occasional resizing of dynamic arraythose bounds are worst case with linked tree structure we conclude that the heap data structure is very efficient realization of the priority queue adtindependent of whether the heap is implemented with linked structure or an array the heap-based implementation achieves fast running times for both insertion and removalunlike the implementations that were based on using an unsorted or sorted list