Least You Need to Know: Monotonic Queues and Sliding-Window Extremes
Lecke megnyitása
A monotonic deque keeps the current window's best candidates in order, so the front always holds the maximum or minimum. It is the standard pattern for sliding-window extrema because it supports both expiration from the left and dominance cleanup from the right.