Sorting streamed multisets |
| |
Authors: | Travis Gagie |
| |
Affiliation: | Dipartimento di Informatica, Università del Piemonte Orientale, Alessandria, AL, Italy |
| |
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. |
| |
Keywords: | Algorithms On-line algorithms Sorting Streaming algorithms |
本文献已被 ScienceDirect 等数据库收录! |
|