In a stack of Size 'N', if there are 'M' elements inserted into the stack and then 'M/2' are popped out. What is the remaining number of elements left in the stack? Assume 'M' < 'N'.
In a stack of Size 'N', if there are 'M' elements inserted into the stack and then 'M/2' are popped out. What is the remaining number of elements left in the stack? Assume 'M' < 'N'.
Solution
✅ Correct Option: 2
Elements left elements pushed elements popped
The size is only the maximum capacity of the stack, so it does not affect the count of elements present.
Related questions:
2025: 22 May Shift 1
2025: 20 May Shift 1
2026: 11 May Shift 2
2026: 20 May Shift 1
2026: 13 May Shift 2