Faster, Space-Efficient Selection Algorithms in Read-Only Memory for Integers
Starting with Munro and Paterson (1980), the selection or median-finding problem has been extensively studied in the read-only memory model and in streaming models. Munro and Paterson’s deterministic algorithm and its subsequent refinements require at least polylogarithmic or logarithmic space, whereas the algorithms by Munro and Raman (1996) and Raman and Ramnath (1999) can be made to use just O(1) storage cells but take O(n 1 + ε ) time for an arbitrarily small constant ε > 0.
In this paper, we show that faster selection algorithms in read-only memory are possible if the input is a sequence of integers. For example, one algorithm uses O(1) storage cells and takes \(O(n\lg U)\) time where U is the universe size. Another algorithm uses O(1) storage cells and takes \(O(n\lg n\lg\lg U)\) time. We also describe an O(n)-time algorithm for finding an approximate median using \(O(\lg^\epsilon U)\) storage cells.
All our algorithms are simple and deterministic. Interestingly, one of our algorithms is inspired by ‘centroids’ of binary trees and finds an approximate median by repeatedly invoking a textbook algorithm for the ‘majority’ problem. This technique could be of independent interest.
KeywordsSelection Algorithm Storage Cell Logarithmic Space Stream Algorithm Streaming Algorithm
Unable to display preview. Download preview PDF.
- 4.Boyer, R.S., Moore, J.S.: MJRTY - A fast majority vote algorithm. In: Boyer, R.S. (ed.) Automated Reasoning: Essays in Honor of Woody Bledsoe. Automated Reasoning Series, pp. 105–117. Kluwer (1991)Google Scholar
- 5.Chakrabarti, A., Jayram, T.S., Pǎtraşcu, M.: Tight lower bound for selection in randomly ordered streams. In: Proceedings of the 19th ACM-SIAM Symposium on Discrete Algorithms (SODA), pp. 720–729 (2008)Google Scholar
- 11.Greenwald, M., Khanna, S.: Space-efficient online computation of quantile summaries. In: Proceedings of ACM SIGMOD, pp. 58–66 (2001)Google Scholar
- 16.Shrivastava, N., Buragohain, C., Agrawal, D., Suri, S.: Medians and beyond: new aggregation techniques for sensor networks. In: Proceedings of the 2nd International Conference on Embedded Networked Sensor Systems, pp. 239–249 (2004)Google Scholar