Article ID Journal Published Year Pages File Type
437840 Theoretical Computer Science 2015 6 Pages PDF
Abstract

Starting with Munro and Paterson (1980) [13], 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) [14] and Raman and Ramnath (1999) [15] can be made to use just O(1)O(1) storage cells but take O(n1+ε)O(n1+ε) time for an arbitrarily small constant ε>0ε>0.In this paper, we initiate the first study on this problem when the input is a sequence of integers. We show that faster selection algorithms in read-only memory are possible if the input is a sequence of integers. For example, one of our algorithms uses O(1)O(1) storage cells and takes O(nlg⁡U)O(nlg⁡U)1 time where U   is the universe size. Another algorithm uses O(1)O(1) storage cells and takes O(nlg⁡nlg⁡lg⁡U)O(nlg⁡nlg⁡lg⁡U) time. A combination of the two yields an algorithm that uses O(1)O(1) words of space and takes O(nlg1+ϵ⁡n)O(nlg1+ϵ⁡n) time, a bound independent of U  . We also describe an O(n)O(n)-time algorithm for finding an approximate median using O(lgε⁡U)O(lgε⁡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.

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