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?

  1. A.

    First node

  2. B.

    Second node

  3. C.

    Last node

  4. 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.

Explore the full course: Amcat Preparation