Open In App
Related Articles

Data Structures | Queue | Question 5

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

A priority queue can efficiently implemented using which of the following data structures? Assume that the number of insert and peek (operation to see the current highest priority item) and extraction (remove the highest priority item) operations are almost same.

(A)

Array

(B)

Linked List

(C)

Heap Data Structures like Binary Heap, Fibonacci Heap

(D)

None of the above



Answer: (C)

Explanation:

A priority queue can be efficiently implemented using a data structure called a binary heap or Fibonacci Heap. A binary heap is a complete binary tree that satisfies the heap property. Binary heaps provide excellent time complexity for these operations, making them an efficient choice for implementing priority queues when the number of insert and peek/extraction operations is roughly equal.

Hence option(C) is the correct answer.



Quiz of this Question
Please comment below if you find anything wrong in the above post

Last Updated : 04 Feb, 2013
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads