Which element would get first deleted from the stack?

2018

Which element would get first deleted from the stack?

  1. A.

    The element in the middle of the stack

  2. B.

    Any specified element

  3. C.

    The element at the bottom of the stack

  4. D.

    The element at the top of the stack

Attempted by 266 students.

Show answer & explanation

Correct answer: D

The correct option is D. A stack is a linear data structure that follows the Last-In, First-Out (LIFO) principle. This means the element added most recently is placed at the top and is the first one to be removed during a pop (deletion) operation.

Explore the full course: Btsc Lab Assistant