Constant-Time Sliding Window Aggregation: A Refined FIFO
2025-08-20
This post presents a refined FIFO data structure enabling constant-time sliding window aggregation. Traditional approaches using dual-stack structures prove inefficient. The author introduces a novel method, cleverly managing 'ingestion' and 'excretion' lists with their running and suffix products, to achieve aggregation over arbitrary monoids with worst-case constant-time complexity. This avoids the extensive copying and redundancy of prior methods, offering significant practical advantages. Python code is included for implementation.
(pvk.ca)
Development