|
|
|
|
|
by materialpoint
351 days ago
|
|
I thought the point of a sliding window, especially a fixed one, is to add the next element and subtract the oldest one from a running sum, to achieve O(1) running time except the start cost. This is what an efficient constant-time median filter in image processing would do, such as Perreault and Hébert's Median Filtering in Constant Time, and Weiss' Fast Median and Bilateral Filtering do. Edit: I can't see the visualizer explaining this part. |
|
Regarding the purpose of the sliding window, you are correct for commutative operations in fixed windows, like maintaining a sum where each operation is O(1). When you're talking about min/max, median, and other operations where adding or removing would not be constant time, as with a priority queue or heap.
Can you elaborate on which aspects you felt are missing from the visualizer?