public class BinaryTreeNode<T> extends Visitable
Constructor and Description |
---|
BinaryTreeNode() |
BinaryTreeNode(BinaryTreeNode<T> parent) |
BinaryTreeNode(T contents) |
Modifier and Type | Method and Description |
---|---|
Object |
getContents() |
BinaryTreeNode<T> |
getLeft() |
BinaryTreeNode<T> |
getRight() |
BinaryTreeNode<T> |
insertLeft(T c) |
BinaryTreeNode<T> |
insertRight(T c) |
boolean |
isLeaf() |
boolean |
isRoot() |
void |
setContents(T contents) |
void |
setLeft(BinaryTreeNode<T> left) |
void |
setRight(BinaryTreeNode<T> right) |
public BinaryTreeNode()
public BinaryTreeNode(BinaryTreeNode<T> parent)
public BinaryTreeNode(T contents)
left
- right
- contents
- public Object getContents()
public BinaryTreeNode<T> getLeft()
public BinaryTreeNode<T> getRight()
public BinaryTreeNode<T> insertLeft(T c)
public BinaryTreeNode<T> insertRight(T c)
public boolean isLeaf()
public boolean isRoot()
public void setContents(T contents)
contents
- public void setLeft(BinaryTreeNode<T> left)
left
- public void setRight(BinaryTreeNode<T> right)
right
- Copyright © 2003–2023 UBC Michael Smith Laboratories. All rights reserved.