If the elements '1', '2', '3' and '4' are added in a stack, so what would be…

2025

If the elements '1', '2', '3' and '4' are added in a stack, so what would be the order for the removal?

  1. A.

    1234

  2. B.

    2134

  3. C.

    4321

  4. D.

    None of the above

Attempted by 569 students.

Show answer & explanation

Correct answer: C

Answer: c

Explanation: The answer is c because stack follows LIFO, which means that the element inserted at the last will be removed first.

Explore the full course: Coding For Placement