public final class BTreeQueue<E> extends Object
The elements in the queue are ordered, and placed into leaf nodes. Each leaf node has at most
BRANCHING_FACTOR elements, and each inner node has at most BRANCHING_FACTOR
elements. The tree is kept balanced so that all the leaves are at the same depth. Nodes whose
entry-count drops below a particular value are compressed to avoid wasting space.
| Constructor and Description |
|---|
BTreeQueue() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E x) |
int |
addIndexOf(E x) |
void |
checkInvariants() |
void |
clear() |
int |
indexBefore(E x) |
int |
indexOf(E x)
Returns the position in the pool, or -1 if the element is not present.
|
int |
internalCapacity() |
E |
peek() |
E |
poll() |
String |
prettyString() |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
public void add(E x)
public int addIndexOf(E x)
public int indexOf(E x)
public int indexBefore(E x)
public E poll()
public E peek()
public void clear()
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
public int internalCapacity()
public void checkInvariants()
public String prettyString()