Private headAdds an element to the end of the list. This is an alias for addLast.
The value to add
Adds an element to the beginning of the list.
The value to add
Adds an element to the end of the list. Traverses the entire list to add the element at the end.
The value to add
Checks if the list contains a specific value.
The value to search for
True if the value exists in the list, false otherwise
Returns the index of the first occurrence of the specified value.
The value to search for
The index of the value, or -1 if not found
A singly linked list data structure. Each element points to the next element in the sequence.
Typeparam
T - The type of elements stored in the list