public class BinaryTree
extends java.lang.Object
Constructor and Description |
---|
BinaryTree()
Constructor, creates a new instance of BinaryTree class.
|
Modifier and Type | Method and Description |
---|---|
BinaryTree |
getLeft()
This method returns the left child node (binary tree) of the current node
|
BinaryTree |
getRight()
This method returns the right child node (binary tree) of the current node
|
int |
getValue()
This method returns the value of a leaf.
|
void |
setLeft(BinaryTree left)
This method sets the left child node (binary tree) of the current node
|
void |
setRight(BinaryTree right)
This method sets the right child node (binary tree) of the current node
|
void |
setValue(int value)
This method sets a value of this leaf.
|
public BinaryTree()
public int getValue()
public void setValue(int value)
value
- Value to set.public BinaryTree getLeft()
public void setLeft(BinaryTree left)
left
- The left node (binary tree) to set to the current nodepublic BinaryTree getRight()
public void setRight(BinaryTree right)
right
- The right node (binary tree) to set to the current node