Which of the following data structures is best for creating a priority queue?
Which of the following data structures is best for creating a priority queue?
ترجیحی قطار بنانے کے لئے مندرجہ ذیل میں سے کون سا ڈیٹا ڈھانچہ بہترین ہے؟
Explanation
A Binary Heap is the most efficient data structure for implementing a priority queue.
It allows both insertion and extraction of the highest (or lowest) priority element in O(log N) time, which makes it ideal for this purpose.