Suggest an editImprove this articleRefine the answer for “What is the LIFO principle in a stack?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**LIFO (Last In, First Out)** is a principle where the last element added is removed first. **Key point:** the element that enters the stack last ends up on top and is the first one removed by the pop() operation.Shown above the full answer for quick recall.Answer (EN)ImageThe **LIFO (Last In, First Out)** principle means that **the last element added is removed first**. That is: 1. The element that enters the stack last ends up **on top**. 2. When removing an element (the `pop` operation), it is exactly this top element that is removed. 3. The remaining elements stay in the stack and wait their turn. Example: If you add the elements `1`, `2`, `3` to the stack (in that order), they come out in reverse order when removed: `3`, `2`, `1`.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.