public class Int2IntRBT extends IntArrayRBTcommon
Modifier and Type | Field and Description |
---|---|
protected int[] |
values |
black, color, default_size, greatestNode, growth_factor, initialSize, klrp, klrp1, klrp2, klrp3, MAXklrp0, MAXklrpMask, multiplication_limit, next, NIL, red, root, size
Constructor and Description |
---|
Int2IntRBT()
Constructor for IntArrayRBT.
|
Int2IntRBT(int initialSize) |
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Int2IntRBT |
copy() |
protected void |
ensureCapacityKlrp(int requiredSize)
There are two strategies for storing data, controlled by useklrp.
|
protected int |
findKeyFast(int k)
Fast version of findKey
Keeps the last node referenced
*** NOT THREAD SAFE ***
Tries to shorten the search path, conditionally
|
void |
flush() |
int |
get(int k)
Get the value for a given key
|
int |
getMostlyClose(int k) |
IntListIterator |
keyIterator() |
IntListIterator |
keyIterator(int aKey) |
IntKeyValueIterator |
keyValueIterator() |
IntKeyValueIterator |
keyValueIterator(int aKey) |
int |
put(int k,
int v)
adds a k, v pair.
|
protected void |
setupArrays() |
compare, contains, containsKey, deleteFixup, deleteNode, ensureArrayCapacity, findInsertionPoint, findInsertionPointCmn, findInsertionPointNoDups, findKey, findKeyDown, getFirstNode, getKeyForNode, getLeft, getParent, getRight, getXXX, initVars, leftRotate, maxDepth, maxDepth, minDepth, minDepth, newNode, nextNode, nextPowerOf2, nodeDepth, nodeDepth, previousNode, printKeys, printKeys, rightRotate, satisfiesRBProps, satisfiesRedBlackProperties, setAsRoot, setLeft, setParent, setRight, setXXX, size
public Int2IntRBT()
public Int2IntRBT(int initialSize)
protected void setupArrays()
setupArrays
in class IntArrayRBTcommon
public Int2IntRBT copy()
public void clear()
public void flush()
flush
in class IntArrayRBTcommon
protected void ensureCapacityKlrp(int requiredSize)
IntArrayRBTcommon
ensureCapacityKlrp
in class IntArrayRBTcommon
requiredSize
- -public int get(int k)
k
- -public int getMostlyClose(int k)
public int put(int k, int v)
k
- -v
- -protected int findKeyFast(int k)
k
- -public IntListIterator keyIterator()
public IntListIterator keyIterator(int aKey)
public IntKeyValueIterator keyValueIterator()
public IntKeyValueIterator keyValueIterator(int aKey)
Copyright © 2017. All rights reserved.