Thursday, June 27, 2013

Define priority queue as an ADT.



Consider a priority queue Q[N] of size N and type T. Then following operations can be performed on the priority queue:
·         MakeEmpty(Q): Make an empty priority queue Q.
·         Isempty(Q): Return TRUE(1) if the queue Q is empty, otherwise FALSE(0).
·         IsFull(Q): Return TRUE(1) if the queue Q is Full, otherwise FALSE(0).
·         insert(Q, x): Add the element ‘x’ in the queue Q according to its priority if the queue Q is not full.
·         deletemin(Q): Delete the minimum priority element if the queue Q is not empty.
·         FindMin(Q): Find the minimum priority element from the queue Q if the Queue is not empty.

No comments:

Post a Comment