Question: Class TreeNode java.lang.Object TreeNode Type Parameters: T - data type of TreeNode public class TreeNode extends java.lang.Object The external Tree Node for Linked Trees Constructor
Class TreeNode
java.lang.Object TreeNode
Type Parameters:
T - data type of TreeNode
public class TreeNode
extends java.lang.Object
The external Tree Node for Linked Trees
| Constructor Summary | |
|---|---|
| TreeNode(T dataNode) Create a new TreeNode with left and right child set to null and data set to the dataNode | |
| TreeNode(TreeNode | |
| Method Summary | |
|---|---|
| T | getData() Return the data within this TreeNode |
| Methods inherited from class java.lang.Object |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
TreeNode
public TreeNode(T dataNode)
Create a new TreeNode with left and right child set to null and data set to the dataNode
Parameters:
dataNode - the data to be stored in the TreeNode
TreeNode
public TreeNode(TreeNodenode)
used for making deep copies
Parameters:
node - node to make copy of
| Method Detail |
|---|
getData
public T getData()
Return the data within this TreeNode
Returns:
the data within the TreeNode
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
