← Quiz: Monotonic Stack: all 13 questions
Quiz: Monotonic Stack · Question 2 of 13
For "next greater element", the stack (from bottom to top) is always:
For "next greater element", the stack (from bottom to top) is always:
- A.decreasing
- B.increasing
- C.sorted by index only, values in any order
- D.empty after every step
Answer & explanation
Correct answer: decreasing
Any element smaller than a newer one has been popped, so what remains decreases.
Can you get the rest right without peeking?
Take the timed Quiz: Monotonic Stack quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →