class PriorityDequeue(T)
- PriorityDequeue(T)
- Reference
- Object
Included Modules
- Indexable(T)
Defined in:
priority_dequeue.crConstant Summary
-
VERSION =
"0.1.0"
Constructors
Instance Method Summary
-
#<<(elem : T)
Add a new element, maintaining priority.
-
#add(elem : T)
Add a new element, maintaining priority.
- #cap : UInt32
-
#del_at(index : UInt32) : T
Delete and return element at index.
- #dump(io : IO)
-
#ensure_total_capacity(new_capacity : UInt32)
Ensure that the dequeue can fit at least
new_capacity
items. -
#ensure_unused_capacity(additional_count : UInt32)
Ensure that the dequeue can fit at least
additional_count
more items. -
#peek_max : T | Nil
Look at the largest element in the dequeue.
-
#peek_min : T | Nil
Look at the smallest element in the dequeue.
-
#pop_max : T | Nil
Pop the largest element from the dequeue.
-
#pop_min : T | Nil
Pop the smallest element from the dequeue.
-
#push(elem : T)
Add a new element, maintaining priority.
-
#size : UInt32
Returns the number of elements in this container.
- #unsafe_fetch(index) : T
- #update(old_elem : T, new_elem : T)
Constructor Detail
Instance Method Detail
Delete and return element at index. Indices are in the same order as iterator, which is not necessarily priority order.
Ensure that the dequeue can fit at least new_capacity
items.
Ensure that the dequeue can fit at least additional_count
more items.
Returns the number of elements in this container.