![]() |
AuD
Lecture 'Algorithmen und Datenstrukturen' (code examples)
|
Public Member Functions | |
int | computeHeight () |
compute height of subtree recursively (for testing only) More... | |
int | getHeight (AVLNode node) |
get height of subtree More... | |
int | getBalance () |
get height difference between left and right subtree More... | |
boolean | isBalanced () |
|getBalance()|<=1 ? More... | |
Protected Member Functions | |
String | textLabel () |
Node in an AVLTree
.
The node stores the height of its subtree for balancing. Note that it is sufficient to store the balance (in only 2 bits). Referring to height instead of balance simplifies this implementation.
Definition at line 24 of file AVLTree.java.
int aud.AVLTree.AVLNode.computeHeight | ( | ) |
compute height of subtree recursively (for testing only)
Definition at line 32 of file AVLTree.java.
References aud.AVLTree.AVLNode.computeHeight().
Referenced by aud.AVLTree.AVLNode.computeHeight().
int aud.AVLTree.AVLNode.getBalance | ( | ) |
get height difference between left and right subtree
Definition at line 53 of file AVLTree.java.
References aud.AVLTree.AVLNode.getHeight().
Referenced by aud.AVLTree.AVLNode.isBalanced().
int aud.AVLTree.AVLNode.getHeight | ( | AVLNode | node | ) |
get height of subtree
node==null
Definition at line 43 of file AVLTree.java.
Referenced by aud.AVLTree.AVLNode.getBalance().
boolean aud.AVLTree.AVLNode.isBalanced | ( | ) |
|getBalance()|<=1
?
Definition at line 57 of file AVLTree.java.
References aud.AVLTree.AVLNode.getBalance().
|
protected |
Definition at line 62 of file AVLTree.java.