Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter. Eric Raymond

Priority queue using stack

Language Java | Level Intermediate | Category Data structure | September 9, 2015 9:45 am


Data structure Description

A priority queue is a data structure with each element associated with priority information. The high priority served before an element with low priority.

Write a program to implement Priority queue using stack


Output

   					 

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

				    

Comments


No comments available!

Please login to add comments.