Which one of the following node is considered the top of the stack if the stack is implemented using the linked list?

Which one of the following node is considered the top of the stack if the stack is implemented using the linked list?

Topic : Stack

A. First node

B. Second node

C. Last node

D. None of the above

Correct Answer is :

A. First node

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.