Package algs33
Class RedBlackBST<K extends Comparable<? super K>,V>
java.lang.Object
algs33.RedBlackBST<K,V>
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate RedBlackBST.Node
<K, V> balance
(RedBlackBST.Node<K, V> h) private RedBlackBST.Node
<K, V> ceiling
(RedBlackBST.Node<K, V> x, K key) private boolean
check()
private boolean
contains
(RedBlackBST.Node<K, V> x, K key) boolean
private RedBlackBST.Node
<K, V> delete
(RedBlackBST.Node<K, V> h, K key) void
void
private RedBlackBST.Node
<K, V> deleteMax
(RedBlackBST.Node<K, V> h) void
private RedBlackBST.Node
<K, V> deleteMin
(RedBlackBST.Node<K, V> h) void
drawTree()
private void
drawTree
(RedBlackBST.Node<K, V> n, double x, double y, double range, int depth) private void
flipColors
(RedBlackBST.Node<K, V> h) private RedBlackBST.Node
<K, V> floor
(RedBlackBST.Node<K, V> x, K key) private V
get
(RedBlackBST.Node<K, V> x, K key) int
height()
private int
height
(RedBlackBST.Node<K, V> x) private boolean
is23()
private boolean
is23
(RedBlackBST.Node<K, V> x) private boolean
private boolean
isBalanced
(RedBlackBST.Node<K, V> x, int black) private boolean
isBST()
private boolean
boolean
isEmpty()
private boolean
private boolean
isRed
(RedBlackBST.Node<K, V> x) private boolean
private boolean
keys()
private void
private Iterable
<RedBlackBST.Node<K, V>> static void
max()
private RedBlackBST.Node
<K, V> max
(RedBlackBST.Node<K, V> x) min()
private RedBlackBST.Node
<K, V> min
(RedBlackBST.Node<K, V> x) private RedBlackBST.Node
<K, V> private RedBlackBST.Node
<K, V> private RedBlackBST.Node
<K, V> void
int
private int
rank
(K key, RedBlackBST.Node<K, V> x) private RedBlackBST.Node
<K, V> rotateLeft
(RedBlackBST.Node<K, V> h) private RedBlackBST.Node
<K, V> select
(int k) private RedBlackBST.Node
<K, V> select
(RedBlackBST.Node<K, V> x, int k) int
size()
private int
size
(RedBlackBST.Node<K, V> x) int
void
toGraphviz
(String filename) private void
toGraphviz
(GraphvizBuilder gb, RedBlackBST.Node<K, V> parent, RedBlackBST.Node<K, V> n) toString()
-
Field Details
-
RED
- See Also:
-
BLACK
- See Also:
-
root
-
-
Constructor Details
-
RedBlackBST
public RedBlackBST()
-
-
Method Details
-
isRed
-
size
-
size
-
isEmpty
-
get
-
get
-
contains
-
contains
-
put
-
put
-
deleteMin
-
deleteMin
-
deleteMax
-
deleteMax
-
delete
-
delete
-
rotateRight
-
rotateLeft
-
flipColors
-
moveRedLeft
-
moveRedRight
-
balance
-
height
-
height
-
min
-
min
-
max
-
max
-
floor
-
floor
-
ceiling
-
ceiling
-
select
-
select
-
rank
-
rank
-
keys
-
keys
-
keys
-
size
-
check
-
isBST
-
isBST
-
isSizeConsistent
-
isSizeConsistent
-
isRankConsistent
-
is23
-
is23
-
isBalanced
-
isBalanced
-
levelOrderNodes
-
toString
-
toGraphviz
-
toGraphviz
-
drawTree
-
drawTree
-
main
-