Use of linked list

why we have taken linked list ? does “psf” value is getting stored as “next” in linked list

@dheerajmishra992 we can use the linked list to implement both queue and stack so we took linked list .we will store the psf as next, the tail node of the linked list and update it after every element we append.
Example:
We have to create a linked list of 3 elements.
We add the first element, the LL is: 1 and in the tail node we store 1.
Now we have to add the second element, 2. Now in this case, tail.next = Node(2) and tail = Node(2). LL is 1->2 and tail node is 2 so

The tail node is null when the list is empty, otherwise it always points to the last node.