For a nonincreasing array, maintain indices such that entries before exceed the target and entries from onward are at most the target. Probe the middle of the half-open interval. A value above the target advances past that index; otherwise set to that index. The interval length decreases geometrically. At termination the common boundary is the first possible match, so one guarded equality test decides presence even with duplicates.

Articles by others on the same topic (0)

There are currently no matching articles.