Source code as used in: An exact and O(1) time heaviest and lightest hitters algorithm for sliding-window data streams, Remous-Aris Koutsiamanis and Pavlos S. Efraimidis, Journal of Internet Technology, pp. 117-126, Vol 14, No 1, ISSN 1607-9264, DOI 10.6138/JIT.2013.14.1.12, Airiti Press, January 1, 2013.
In this work we focus on the problem of finding the heaviest-k and lightest-k hitters in a sliding window data stream. We propose a novel algorithm which for the first time, to our knowledge, provides exact, not approximate, results while at the same time achieves O(1) time with high probability complexity on both update and query operations.