Optimal-time algorithm for slope selection

Richard Cole, Jeffrey S. Salowe, W. L. Steiger, Endre Szemeredi

Research output: Contribution to journalArticle


Given n points in the plane and an integer k, the problem of selecting that pair of points that determines the line with the kth smallest or largest slope is considered. In the restricted case, where k is O(n), line sweeping gives an optimal, O(n log n)-time algorithm. For general k the parametric search technique of Megiddo is used to describe an O(n(log n)2)-time algorithm. This is modified to produce a new, optimal O(n log n)-time selection algorithm by incorporating an approximation idea.

Original languageEnglish (US)
Pages (from-to)792-810
Number of pages19
JournalSIAM Journal on Computing
Issue number4
StatePublished - Jan 1 1989


ASJC Scopus subject areas

  • Computer Science(all)
  • Mathematics(all)

Cite this

Cole, R., Salowe, J. S., Steiger, W. L., & Szemeredi, E. (1989). Optimal-time algorithm for slope selection. SIAM Journal on Computing, 18(4), 792-810. https://doi.org/10.1137/0218055