In a linked list implementation of a stack, insertion and deletion operations are performed at one end of the list. For a linked list queue, insertion is done at one end while deletion is done at the other end, following the first-in first-out (FIFO) principle. The first node is considered the top of the stack as new elements are always added to the beginning of the linked list for a stack.
In a linked list implementation of a stack, insertion and deletion operations are performed at one end of the list. For a linked list queue, insertion is done at one end while deletion is done at the other end, following the first-in first-out (FIFO) principle. The first node is considered the top of the stack as new elements are always added to the beginning of the linked list for a stack.
In a linked list implementation of a stack, insertion and deletion operations are performed at one end of the list. For a linked list queue, insertion is done at one end while deletion is done at the other end, following the first-in first-out (FIFO) principle. The first node is considered the top of the stack as new elements are always added to the beginning of the linked list for a stack.
Note: In Linked List implementation of Stack, Insertion & Deletion operations
performed at 1 end. In Linked List implementation of Queue, Insertion & Deletion operations performed at other ends. Ans: (d) Explanation: Whenever the element is added to the Linked List, it is always added at the beginning of the list. Therefore, we can say that the First Node in the Linked List is considered as the Top of the Stack. Ans: (a)
Explanation: Since Queue follows FIFO, so new element inserted at last.