There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult. C.A.R. Hoare

Max heap priority queue

Language Java | Level Intermediate | Category Algorithms | August 3, 2015 8:03 am


Algorithm Problem Description

Priority queues insert the largest key value at the front of the queue (max heap). Write a program to implement max heap priority queue.

Output

          	        
          	        

Array of items for insert Priority Queue: [4, 1, 3, 2, 16, 9, 10, 14, 8, 7]
Itmes from Priority Queue: 16 14 10 8 7 3 9 1 4 2 
Itmes from Priority Queue extracted using Max items: 16 14 10 9 8 7 4 3 2 1 

          	        
          	        				    


Comments



Please login to add comments.