|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--asd_library.tree.bstree.BSTNode
Basic node stored in a binary search tree.
Field Summary | |
protected java.lang.Comparable |
key
The key of the node. |
protected BSTNode |
leftChild
The left child node of current node. |
protected BSTNode |
rightChild
The right child node of current node. |
Constructor Summary | |
|
BSTNode()
Constructs a new node. |
|
BSTNode(java.lang.Comparable el)
Constructs a new node. |
protected |
BSTNode(java.lang.Comparable el,
BSTNode par,
BSTNode lt,
BSTNode rt)
|
Method Summary | |
java.lang.Comparable |
getKey()
Returns the key of the node. |
BSTNode |
getLeftChild()
Returns the left child of the node. |
BSTNode |
getRightChild()
Returns the right child of the node. |
boolean |
isLeaf()
Verifies if this BSTNode is a leaf. |
void |
visit()
Prints the String that represents the key of the node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected java.lang.Comparable key
protected BSTNode leftChild
protected BSTNode rightChild
Constructor Detail |
public BSTNode()
public BSTNode(java.lang.Comparable el)
el
- the element to insert.protected BSTNode(java.lang.Comparable el, BSTNode par, BSTNode lt, BSTNode rt)
el
- lt
- rt
- Method Detail |
public java.lang.Comparable getKey()
public BSTNode getLeftChild()
public BSTNode getRightChild()
public void visit()
public boolean isLeaf()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |