Class ListNode<T>
java.lang.Object
com.amritpandey23.dsalibrary.linkedlist.ListNode<T>
- Type Parameters:
T- the type of the value stored in the list node
Represents a node in a singly linked list, containing a generic value and a
reference to the next node.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
val
The value stored in this list node. -
next
Pointer to the next node in the list.
-
-
Constructor Details
-
ListNode
Constructs a list node with a specified value and no reference to the next node.- Parameters:
val- the value to be stored in this list node
-
ListNode
Constructs a list node with a specified value and a reference to the next node.- Parameters:
val- the value to be stored in this list nodenext- the next node in the list
-