Is there specific algorithm that allows me to maintain a min/max over a small/medium sized sliding window (typical size is 600, with all elements being integers)? The window is really the last N observations in a stream. So, I add a new observation and remove the oldest observation at each time unit, so I'd like to keep the min and max over the last N obervations.
This is a different problem from the one stated in Sliding window minimum algorithm because I do not maintain the entire data, and therefore the "index-based" solution will not be applicable here. Moreover my input data itself will be in a circular array.
Heaps will probably not work too well: I don't delete/pop the Min/Max element, but the oldest element, which will defeat the purpose of having the heap in the first place.
log(n) complexity-based structures such as Red-black trees will work just fine, and splay trees may be even more suitable for the type of data I'd have, but are they a bit of an overkill for the size I'd deal with?