Unidirectional Input/Output Streaming Complexity of Reversal and Sorting
Abstract
We consider unidirectional data streams with restricted access, such as readonly and writeonly streams. For readwrite streams, we also introduce a new complexity measure called expansion, the ratio between the space used on the stream and the input size. We give tight bounds for the complexity of reversing a stream of length $n$ in several of the possible models. In the readonly and writeonly model, we show that $p$pass algorithms need memory space ${\Theta}(n/p)$. But if either the output stream or the input stream is readwrite, then the complexity falls to ${\Theta}(n/p^2)$. It becomes $polylog(n)$ if $p = O(log n)$ and both streams are readwrite. We also study the complexity of sorting a stream and give two algorithms with small expansion. Our main sorting algorithm is randomized and has $O(1)$ expansion, $O(log n)$ passes and $O(log n)$ memory.
 Publication:

arXiv eprints
 Pub Date:
 September 2013
 arXiv:
 arXiv:1309.0647
 Bibcode:
 2013arXiv1309.0647F
 Keywords:

 Computer Science  Data Structures and Algorithms;
 Computer Science  Computational Complexity;
 F.2.0