Q.Q. 17 and 18 are Assertion (A) and Reasoning (R) based questions. Mark the correct choice as
You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.
Start your 14-day free trial to unlock the full solution →A stack is indeed LIFO, but the reason given confuses implementation detail (index positioning) with the defining principle (last-in, first-out access), so both are true yet the reasoning does not explain the assertion.
A stack is one of the most elegant data structures in computer science, defined entirely by how you interact with it rather than how it is built underneath. The assertion calls it a LIFO structure—Last In, First Out—which captures the essence perfectly. Imagine a stack of plates: you add a new plate on top, and when you need one, you take from the top. The last plate you placed is the first one you remove. That access discipline, that rule of engagement, is what makes a stack a stack.
The reason statement shifts the conversation to implementation. It says that when you push a new element, it gets positioned at the index after the last existing element. This is true if you implement a stack using an array or list, where elements occupy consecutive indices and the "top" pointer advances with each push. But here is the subtle disconnect: the LIFO nature of a stack is not because elements are stored sequentially in memory. LIFO is a logical property, a contract about the order of retrieval. You could implement a stack with a linked list where elements are scattered across memory, each pointing to the one below it, and it would still be LIFO. The sequential indexing is an artifact of one common implementation, not the reason the structure behaves as last-in, first-out.
The defining characteristic of a stack is the restriction on access—only the top element is reachable for removal. Whether that top is tracked by an index, a pointer, or any other mechanism is secondary. …
Unlock everything free for 14 days
- Full step-by-step solutions
- Concept-first explanations
- Methods, shortcuts & mistakes
- PYQ mapping + timed mock tests
Full access for 14 days. No credit card required.