edited by
1,484 views

1 Answer

2 votes
2 votes

Priority queue has the priority associated with each element.

so 1 queue will store the elements and 2nd queue will give the priority to the elements which are stored in the queue.

we will need 2 queues

Related questions

0 votes
0 votes
0 answers
1
srestha asked Dec 22, 2018
604 views
Is priority queue work efficiently with sorted array than unsorted array and heap for insertion and deletion operation? Then why do we apply priority queue in heap specia...
0 votes
0 votes
1 answer
3
rahul sharma 5 asked Dec 17, 2016
996 views
How to implement Priority queue using stack?What will be time complexity for Enqueue and Dequeue operations?Edit:- Updated the question clearly