2018/05/01 by Braverman, Vladimir, Grigorescu, Elena, Lang, Harry +2 · 4 citations
#Data Structures and Algorithms (cs.DS) #FOS: Computer and information sciences
paper · doi:10.48550/arxiv.1805.00212
We study the distinct elements and ℓp-heavy hitters problems in the sliding window model, where only the most recent n elements in the data stream form the underlying set. We first introduce the composable histogram, a simple twist on the exponential (Datar et al., SODA 2002) and smooth histograms (Braverman and Ostrovsky, FOCS 2007) that may be of independent interest. We then show that the composable histogram along with a careful combination of existing techniques to track either the identity or frequency of a few specific items suffices to obtain algorithms for both distinct elements and ℓp-heavy hitters that are nearly optimal in both n and ε. Applying our new composable histogram framework, we provide an algorithm that outputs a (1+ε)-approximation to the number of distinct elements in the sliding window model and uses O((1)/(ε2)log nlog\frac1εloglog n+\frac1εlog2 n) bits of space. For ℓp-heavy hitters, we provide an algorithm using space O((1)/(εp)log3 n(loglog n+log\frac1ε)) for 0