[Issue 12992] Add an interpolate policy to binary search policies

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jun 25 08:00:15 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12992

--- Comment #2 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to bearophile_hugs from comment #1)
> Interpolated search is nice, but it requires a knowledge of the distribution
> of the data.

That's why it's a policy chosen by the caller.

> In general it's not easy to know it (and even if you know it,
> you need a give a lambda to the search function).

If the element type is numeric no lambda is needed.

--


More information about the Digitalmars-d-bugs mailing list