English

Unidirectional Input/Output Streaming Complexity of Reversal and Sorting

Data Structures and Algorithms 2014-07-21 v5 Computational Complexity

Abstract

We consider unidirectional data streams with restricted access, such as read-only and write-only streams. For read-write 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 nn in several of the possible models. In the read-only and write-only model, we show that pp-pass algorithms need memory space Θ(n/p){\Theta}(n/p). But if either the output stream or the input stream is read-write, then the complexity falls to Θ(n/p2){\Theta}(n/p^2). It becomes polylog(n)polylog(n) if p=O(logn)p = O(log n) and both streams are read-write. 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)O(1) expansion, O(logn)O(log n) passes and O(logn)O(log n) memory.

Keywords

Cite

@article{arxiv.1309.0647,
  title  = {Unidirectional Input/Output Streaming Complexity of Reversal and Sorting},
  author = {Nathanaël François and Rahul Jain and Frederic Magniez},
  journal= {arXiv preprint arXiv:1309.0647},
  year   = {2014}
}
R2 v1 2026-06-22T01:19:40.065Z