V - The vertex typepublic class BinaryTreeNode<V extends Vertex>
extends java.lang.Object
| Constructor and Description |
|---|
BinaryTreeNode(V vertex)
Constructs a binary tree node associated with the given vertex
|
BinaryTreeNode(V vertex,
BinaryTreeNode<V> left,
BinaryTreeNode<V> right)
Construct a binary tree node associated with the given vertex
and sets nodes to its right and left
|
BinaryTreeNode(V vertex,
BinaryTreeNode<V> left,
BinaryTreeNode<V> right,
BinaryTreeNode<V> parent)
Construct a binary tree node associated with the given vertex
and sets nodes to its right and left as well as its parent
|
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight() |
BinaryTreeNode<V> |
getLeft() |
BinaryTreeNode<V> |
getParent() |
BinaryTreeNode<V> |
getRight() |
V |
getVertex() |
void |
setHeight(int height) |
void |
setLeft(BinaryTreeNode<V> left) |
void |
setParent(BinaryTreeNode<V> parent) |
void |
setRight(BinaryTreeNode<V> right) |
void |
setVertex(V vertex) |
java.lang.String |
toString() |
public BinaryTreeNode(V vertex)
vertex - Vertex associated with the nodepublic BinaryTreeNode(V vertex, BinaryTreeNode<V> left, BinaryTreeNode<V> right)
vertex - Vertex associated with the nodeleft - Node to the left of the noderight - Node to the right of the nodepublic BinaryTreeNode(V vertex, BinaryTreeNode<V> left, BinaryTreeNode<V> right, BinaryTreeNode<V> parent)
vertex - Vertex associated with the nodeleft - Node to the left of the noderight - Node to the right of the nodeparent - Node's parentpublic V getVertex()
public void setVertex(V vertex)
vertex - Vertex associated with the node to setpublic BinaryTreeNode<V> getLeft()
public void setLeft(BinaryTreeNode<V> left)
left - Node to the left of the node to setpublic BinaryTreeNode<V> getRight()
public void setRight(BinaryTreeNode<V> right)
right - Node to the right of the node to setpublic BinaryTreeNode<V> getParent()
public void setParent(BinaryTreeNode<V> parent)
parent - Parent to setpublic java.lang.String toString()
toString in class java.lang.Objectpublic int getHeight()
public void setHeight(int height)
height - Height to set