Article ID Journal Published Year Pages File Type
428177 Information Processing Letters 2008 4 Pages PDF
Abstract

Sorting is a classic problem and one to which many others reduce easily. In the streaming model, however, we are allowed only one pass over the input and sublinear memory, so in general we cannot sort. In this paper we show that, to determine the sorted order of a multiset s of size n containing σ⩾2 distinct elements using one pass and o(nlogσ) bits of memory, it is generally necessary and sufficient that its entropy H=o(logσ). Specifically, if s={s1,…,sn} and si1,…,sin is the stable sort of s, then we can compute i1,…,in in one pass using O((H+1)n) time and O(Hn) bits of memory, with a simple combination of classic techniques. On the other hand, in the worst case it takes that much memory to compute any sorted ordering of s in one pass.

Related Topics
Physical Sciences and Engineering Computer Science Computational Theory and Mathematics