Which one of the following node is considered the top of the stack if the…
2024
Which one of the following node is considered the top of the stack if the stack is implemented using the linked list?
- A.
First node
- B.
Second node
- C.
Last node
- D.
None of the above
Attempted by 450 students.
Show answer & explanation
Correct answer: A
Answer: a
Explanation: The answer is a, i.e., First node. As we know, that last inserted element in the stack is considered as the top of the stack. 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.