recategorized by
5,839 views
0 votes
0 votes

What is the most appropriate data structure to implement a priority queue ?

  1. Heap
  2. Circular array
  3. Linked list
  4. Binary tree
recategorized by

2 Answers

0 votes
0 votes

(A) Heap ...

 

Priority queue can be implemented using an array, a linked list, a heap data structure.

Among these data structures, heap data structure provides an efficient implementation of priority queues.

In a normal queue, queue is implemented based on FIFO but in priority queue nodes are removed based on the priority...

 

Time complexity of priority queue using binary heap or binary search tree :

1. Insert operation takes : O( log n )..

2. Delete operation takes : O (log n ) …

 

Related questions

1 votes
1 votes
2 answers
1
makhdoom ghaya asked Sep 16, 2016
2,096 views
Which of the following expression is represented by the parse tree ?$(A + B) ^{*} C$$A + ^{*} BC$$A + B * C$$A * C + B$
1 votes
1 votes
2 answers
2
makhdoom ghaya asked Sep 15, 2016
4,608 views
In a $B$ tree of order $5$, the following keys are inserted as follows : $7, 8, 1, 4, 13, 20, 2, 6$ and $5$ How many elements are present in the root of the tree ?$1$ $2$...
0 votes
0 votes
3 answers
3
makhdoom ghaya asked Sep 15, 2016
2,239 views
A chained hash table has an array size of $100$. What is the maximum number of entries that can be placed in the table ?$100$$200$$10000$There is no upper limit
2 votes
2 votes
1 answer
4
makhdoom ghaya asked Sep 15, 2016
5,177 views
In a complete binary tree of n nodes, how far are the two most distant nodes ? Assume each edge in the path counts as !About $\log_{2} n$About $2 \log_{2} n$About $n \log...