Add Element into the linked list
[10, 1, 12, 4, 8]
Create a new linked list and pass the another list
[10, 1, 12, 4, 8, 14, 18]
Iterator of List : 10 1 12 4 8 14 18
move in the forward direction
10 1 12 4 8 14 18
move in the backward direction
18 14 8 4 12 1 10
iterate list using for loop
10 1 12 4 8 14 18
iterate list using for each loop
10 1 12 4 8 14 18 LinkedList as Deque
getFirst element in linkedlist : 10
getLast element in linkedlist : 18
Is linkedlist Empty : false
Get an element from position 2 : 1
Linked List as Stack
Peek Element:2
[2, 1, 10, 1, 12, 4, 8]