MutPriorityQueue
0.40.0
Definitions
def
dequeue
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: Option[a]
\ r
with
Order[a]
Removes and optionally returns the top element of pq
.
def
enqueue
[ar]
(
pq :
MutPriorityQueue[a, r]
x :
a
)
: Unit
\ r
with
Order[a]
Enqueues an element x
into a pq
.
def
enqueueAll
[arm]
(
pq :
MutPriorityQueue[a, r]
m :
m[a]
)
: Unit
\ r
with
Order[a]
Iterable[m]
Enqueues each element in l
into pq
.
def
isEmpty
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: Bool
\ r
Returns whether pq
is empty.
def
iterator
[r1ar2]
(
rc :
Region[r1]
pq :
MutPriorityQueue[a, r2]
)
: Iterator[a, r1 + r2, r1]
\ r1 + r2
Returns an iterator over pq
.
Modifying pq
during iteration is undefined and not recommended.
def
new
[ra]
(
rc :
Region[r]
)
: MutPriorityQueue[a, r]
\ r
Returns an empty MutPriorityQueue.
def
peek
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: Option[a]
\ r
Optionally returns the top element of pq
.
def
size
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: Int32
\ r
Returns the number of elements in pq
.
def
toArray
[r1ar2]
(
rc :
Region[r1]
pq :
MutPriorityQueue[a, r2]
)
: Array[a, r1]
\ r1 + r2
Returns an Array representation of pq
.
Note that a MutPriorityQueue's element order depends on the order in which the elements were enqueued.
def
toList
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: List[a]
\ r
with
Order[a]
Returns a List representation of pq
.
Note that a MutPriorityQueue's element order depends on the order in which the elements were enqueued.
def
toNel
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: Option[Nel[a]]
\ r
with
Order[a]
Optionally returns a Nel representation of pq
.
def
toString
[ar]
(
pq :
MutPriorityQueue[a, r]
)
: String
\ r
with
ToString[a]
Returns a String representation of the mutable priority queue pq
.