Rolling Median Sort
Rolling Median Sort Rolling median sort maintains the median value over a sliding window. Instead of fully sorting the window, it keeps just enough structure to extract the median efficiently. You use it when median or percentile queries are needed over recent data. Problem Given a stream ( x_1, x_2, \dots ) and window size ( w ), compute the median of: [ [x_{t-w+1}, \dots, x_t] ] after each step....