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 node) used for making deep copies

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(TreeNode node) 

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!