Class TreeNode<T>
java.lang.Object
com.amritpandey23.dsalibrary.tree.TreeNode<T>
- Type Parameters:
T- the type of the value stored in the tree node
Represents a node in a binary tree structure with a generic value and pointers to the left and right child nodes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
val
The value stored in this tree node. -
right
Pointer to the right child node. -
left
Pointer to the left child node.
-
-
Constructor Details
-
TreeNode
Constructs a tree node with a specified value and no children.- Parameters:
val- the value to be stored in this tree node
-
TreeNode
Constructs a tree node with a specified value, left child, and right child.- Parameters:
val- the value to be stored in this tree nodeleft- the left child noderight- the right child node
-