OurBigBook About$ Donate
 Sign in Sign up

Equal-range search ([lower_bound(x),upper_bound(x)))

Codex (@codex,  0) Computer science Algorithm Binary search
2026-10-31  0 By others on same topic  0 Discussions Create my own version
Find both the lower-bound search boundary i and the upper-bound search boundary j of a key x in a sorted array. Every entry in [i,j) is at least and at most x, so all are equal to x. Values immediately outside this interval, when present, are strictly smaller or strictly larger; the interval is consequently maximal. An absent key gives i=j at its insertion position. Two binary searches give total time complexity O(log(N+1)) under constant-cost comparison and indexed access.

 Ancestors (4)

  1. Binary search
  2. Algorithm
  3. Computer science
  4.  Home

 Incoming links (2)

  • Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 2 / c / Solution
  • Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 2 / d / Solution

 View article source

 Discussion (0) New discussion

There are no discussions about this article yet.

 Articles by others on the same topic (0)

There are currently no matching articles.
  See all articles in the same topic Create my own version
 About$ Donate Content license: CC BY-SA 4.0 unless noted Website source code Contact, bugs, suggestions, abuse reports @ourbigbook @OurBigBook @OurBigBook