1. Base Monotonic Deque

    Base Monotonic Deque When To Use Use this when you need the best max/min candidate among active indices. The deque stores indices.

  2. Base Monotonic Stack

    Base Mono Stack When To Use Use this when each index needs the nearest greater/smaller element on one side.

  3. DP Window Optimisation

    DP Window Optimisation When To Use Use this when a DP transition asks for min or max over a moving valid range.

  4. Fixed Window Extrema

    Fixed Window Extrema When To Use Use this when every query is over a fixed-size window and you need the max or min.

  5. Prefix Sum Candidates

    Prefix Sum Candidates When To Use Use this when candidates are prefix indices and the deque keeps the best prefix sums.

  6. Variable Window Max Min

    Variable Window Max Min When To Use Use this when a variable-size window is valid based on the current max and min.

  7. Contribution by Boundary

    Contribution By Boundary When To Use Use this when summing over all subarrays and each element contributes as the minimum or maximum over some range.

  8. Farthest Candidate Stack

    Farthest Candidate Stack When To Use Use this when you need the farthest valid index, not the nearest greater/smaller index.

  9. Greedy Remove Stack

    Greedy Remove Stack When To Use Use this when building a lexicographically smallest/largest subsequence while you are allowed to drop elements.

  10. Histogram Expansion

    Histogram Expansion When To Use Use this when choosing an index as the minimum height/value and expanding as far as possible improves the objective.