What extra ability does Min Stack need?
Practice this question from Min Stack - Auxiliary stack Pattern Practice Quiz, with options and an explanation.
Question
What extra ability does Min Stack need?
Option A — Correct answer
Return the current minimum in O(1)
Option B
Sort the stack
Option C
Return the maximum only
Option D
Support graph traversal
Explanation
It must return the current minimum in O(1).