Re:Binary search with confidence
by hddqsb on Monday March 07, 2022 @11:44AM
(#30590027)
Note that with this version, the expected number of calls to `predicate` can be 1 more than strictly necessary (depending on n). This happens when n is one more than a power of 2, e.g. if n is 65 then `bit` is 64 and the first call will be `predicate(64)`, which is basically useless in reducing the search space.
[ Parent
| on HN ]