The best programmers are not marginally better than merely good ones. They are an order-of-magnitude better, measured by whatever standard: conceptual creativity, speed, ingenuity of design, or problem-solving ability. Randall E. Stross

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



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



No comments available!

Please login to add comments.