← Quiz: Monotonic Stack: all 13 questions
Quiz: Monotonic Stack · Question 10 of 13
After the loop, what do the indexes still left on the "next greater" stack mean?
After the loop, what do the indexes still left on the "next greater" stack mean?
- A.Those elements have no greater element to their right
- B.Those elements are the largest in the array
- C.Those elements were processed twice
- D.The algorithm failed for them
Answer & explanation
Correct answer: Those elements have no greater element to their right
Nothing larger came after them, so their answer stays at the default −1.
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 →