Computer Science, asked by Griezmann674, 1 year ago

How to find kth smallest element in priority queue?

Answers

Answered by Geekydude121
0

In order to find the kth smallest element in priority queue at first we need to use -min i.e heap

Then we need to insert all the elements in the priority queue correspondingly.

Then we need to extract the k elements from the priority queue.The last element will be the first element in the element according to last in first out method.

Similar questions