Groups
Category
A Merge Sort Tree is a segment tree where every node stores the sorted list of values in its segment.
A monotonic deque is a double-ended queue that keeps elements in increasing or decreasing order so that the front always holds the current optimum (min or max).