Moving Average — a circular buffer
A fixed-size buffer holds the last k values. Each new value overwrites the oldest slot, and the running sum is patched in O(1) — no re-adding the whole window.
Try:
← Prev
Next →
▶ Play
Reset
circular buffer
window sum
0
moving average
—