public static enum IntPriorityQueue.Mode extends Enum<IntPriorityQueue.Mode>
Enum Constant and Description |
---|
BOUNDED
Sets the priority queue to use a backing array that indexes into the
heap.
|
HASH
Sets the priority queue to use a backing hashtable to map values to
their position in the heap.
|
STANDARD
Sets the priority queue to use the standard queue implementation with
the standard complexity for the following operations
O(1) time for IntPriorityQueue.peek() O(log n) time for IntPriorityQueue.poll() , AbstractQueue.add(java.lang.Object) O(n) time for IntPriorityQueue.remove(java.lang.Object) and IntPriorityQueue.contains(java.lang.Object) And calling Iterator.remove() is O(log n), but the iteration is in no particular order |
Modifier and Type | Method and Description |
---|---|
static IntPriorityQueue.Mode |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static IntPriorityQueue.Mode[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final IntPriorityQueue.Mode STANDARD
IntPriorityQueue.peek()
IntPriorityQueue.poll()
, AbstractQueue.add(java.lang.Object)
IntPriorityQueue.remove(java.lang.Object)
and IntPriorityQueue.contains(java.lang.Object)
Iterator.remove()
is O(log n), but the iteration is in no particular orderpublic static final IntPriorityQueue.Mode HASH
IntPriorityQueue.peek()
and IntPriorityQueue.contains(java.lang.Object)
IntPriorityQueue.poll()
, AbstractQueue.add(java.lang.Object)
,
and IntPriorityQueue.remove(java.lang.Object)
Iterator.remove()
is O(log n), but the iteration
is in no particular orderpublic static final IntPriorityQueue.Mode BOUNDED
IntPriorityQueue.remove(java.lang.Object)
and IntPriorityQueue.contains(java.lang.Object)
are needed. However, it must create an array as large as the largest
int value put into the queue, and negative values will not be accepted.
This method is best when the size of the queue is known to be bounded
and all values are in the range [0, N].IntPriorityQueue.peek()
and IntPriorityQueue.contains(java.lang.Object)
IntPriorityQueue.poll()
, AbstractQueue.add(java.lang.Object)
,
and IntPriorityQueue.remove(java.lang.Object)
Iterator.remove()
is O(log n), but the iteration
is in no particular orderpublic static IntPriorityQueue.Mode[] values()
for (IntPriorityQueue.Mode c : IntPriorityQueue.Mode.values()) System.out.println(c);
public static IntPriorityQueue.Mode valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2017. All rights reserved.