We consider the problem of computing the minimum of n values, and several well-known generalizations [prefix minima, range minima, and all nearest smaller values (ANSV)] for input elements drawn from the integer domain [1 … s], where s ≥ n. In this article we give simple and efficient algorithms for all of the preceding problems. These algorithms all take O(log log log s) time using an optimal number of processors and O(ns~ε) space (for constant ε < 1) on the COMMON CRCW PRAM. The best known upper bounds for the range minima and ANSV problems were previously O(log log n) (using algorithms for unbounded domains). For the prefix minima and for the minimum problems, the improvement is with regard to the model of computation. We also prove a lower bound of Ω(log log n) for domain size s = 2~(Ω(log n log log n)). Since, for s at the lower end of this range, log log n = Ω(log log log s), this demonstrates that any algorithm running in o(log log log s) time must restrict the range of s on which it works.
展开▼