Priority queue: Difference between revisions

Content added Content deleted
m (added whitespace.)
m (indented the numbered list.)
Line 5: Line 5:
;Task:
;Task:
Create a priority queue.   The queue must support at least two operations:
Create a priority queue.   The queue must support at least two operations:
#   Insertion.   An element is added to the queue with a priority (a numeric value).
:#   Insertion.   An element is added to the queue with a priority (a numeric value).
#   Top item removal.   Deletes the element or one of the elements with the current top priority and return it.
:#   Top item removal.   Deletes the element or one of the elements with the current top priority and return it.