Skip to main content

A generalization of binary search

  • Invited Presentations
  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 709))

Abstract

Let f be a nondecreasing integer-valued function whose domain is the set of integers [0., n]. The (n, m) problem is the problem of determining f at all points of its domain, given that f(0)=0 and f(n)=m. The paper [HM] determines the worst-case number of function evaluations needed to solve the (n, m) problem and gives one particular algorithm achieving the worst-case bound. We obtain the following further results concerning this problem:

  • A family of deterministic algorithms that minimizes the worst-case number of function evaluations needed to solve the (n, m)-problem;

  • A deterministic algorithm that comes within one step of minimizing the worst-case number of parallel steps required to solve the (n,m)-problem, where a given number p of concurrent function evaluations may be performed in each parallel step. This result requires that p ≤ m;

  • A deterministic algorithm that minimizes the expected number of function evaluations when the function f is drawn from a probability distribution satisfying a natural symmetry property;

  • A randomized algorithm that minimizes the worst-case expected number of function evaluations required to solve the (n, 1)-problem;

  • Lower and upper bounds on the worst-case expected number of function evaluations required by a randomized algorithm to solve the (n, m)-problem for m > 1;

All the algorithms presented in the paper are extremely simple.

The (n, m) problem is equivalent to the following natural search problem: given a table consisting of n entries in increasing order, and given keys x 1 < x 2 < ... < x m, determine which of the given keys lie in the table. It is easily seen that the worst-case number of table entries that must be inspected in the search problem is equal to the worst-case number of function evaluations needed to solve the (n, m) problem.

Research supported by NSF Grant No. CCR-9005448

This is a preview of subscription content, log in via an institution.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. C.R. Glassey and R.M. Karp, “On the Optimality of Huffman Trees,” SIAM J. Applied Math, Vol. 31, No. 2, pp. 368–378, September, 1976.

    Article  Google Scholar 

  2. R. Hassin and N. Megiddo, “An Optimal Algorithm for Finding All the Jumps of a Monotone Step-Function,” J. Algorithms, Vol. 6, No. 2, pp. 265–274, June, 1985.

    Article  Google Scholar 

  3. A.C.C. Yao, “Probabilistic Computation: Towards a Unified Measure of Complexity,” Proc. 18th IEEE Symp. on Foundations of Computer Science, pp. 222–227, 1977.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Frank Dehne Jörg-Rüdiger Sack Nicola Santoro Sue Whitesides

Rights and permissions

Reprints and permissions

Copyright information

© 1993 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Karp, R.M. (1993). A generalization of binary search. In: Dehne, F., Sack, JR., Santoro, N., Whitesides, S. (eds) Algorithms and Data Structures. WADS 1993. Lecture Notes in Computer Science, vol 709. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-57155-8_232

Download citation

  • DOI: https://doi.org/10.1007/3-540-57155-8_232

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-57155-1

  • Online ISBN: 978-3-540-47918-5

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics