Abstract

In the classic selection problem the task is to find the kth smallest of N elements. We study the complexity of this problem on a space-bounded random-access machine: The input is given in a read-only array and the capacity of workspace is limited. We prove that the linear-time prune-and-search algorithm—presented in most textbooks on algorithms—can be adjusted to use O(N) bits instead of Θ(N) words of extra space. Prior to our work, the best known algorithm by Frederickson could perform the task with O(N) bits of extra space in O(N log* N) time. In particular, our result separates the space-restricted random-access model and the multi-pass streaming model (since we can bypass the Ω(N log* N) lower bound known for the latter model). We also generalize our algorithm for the case when the size of the workspace is O(S) bits, \(\lg^3{N} \leq S \leq N\). The running time of our generalized algorithm is \(O(N \lg^{*}(N/S) + N \lg{} N / \lg{} S)\), slightly improving over the bound \(O(N \lg^{*}(N \lg{} N/S) + N \lg{} N / \lg{} S)\) of Frederickson’s algorithm. Of independent interest, the wavelet stack—a structure we used for repeated pruning—may also be useful in other applications.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.