Use a min-heap and max-heap together to track medians, sliding window extremes, and dynamic ordering.