Python: In Python, which comparison about Monotonic Stack is accurate?

Difficulty:

Easy

Questions:

1

Time Limit:

2 minutes

Passing Score:

100%

Question

In Python, which comparison about Monotonic Stack is accurate?

  1. There is no practical difference in behavior, performance, or maintainability when Monotonic Stack is involved.
  2. The oldest option related to Monotonic Stack is always the right production choice regardless of workload or context.
  3. A monotonic stack avoids repeated rescanning of neighbors, while brute-force approaches revisit the same comparisons many times.
  4. Differences around Monotonic Stack are mostly cosmetic, so correctness and debugging quality do not really change.

Hint

Focus on the behavior or tradeoff, not just the keyword.

Answer and rationale

Correct answer: C. A monotonic stack avoids repeated rescanning of neighbors, while brute-force approaches revisit the same comparisons many times.

A monotonic stack avoids repeated rescanning of neighbors, while brute-force approaches revisit the same comparisons many times. This is the comparison that usually separates memorization from understanding.

Track: Python