An indirect priority queue.
An indirect priority queue provides a way to
by index elements taken from a given reference list,
and to
them in some specified order.
Elements that are smaller in the specified order are
dequeued first. It
is also possible to get the
, that
is, the index that would be dequeued next.
Additionally, the queue may provide a method to peek at the index of the
element that would be dequeued
.
The reference list should not change during queue operations (or, more
precisely, the relative order of the elements in the queue should not
change). Nonetheless, some implementations may give the caller a way to
notify the queue that the
.
Optionally, an indirect priority queue may even provide methods to notify
, and to
any
element of the reference list presently in the queue. It may even allow to
notify that
.
It is always possible to enqueue two distinct indices corresponding to
equal elements of the reference list. However, depending on the
implementation, it may or may not be possible to enqueue twice the same
index.
Note that all element manipulation happens via indices.
|