Since you replied to my message rather than to David's, I assume you had seen
the [issue] I linked.
Masquerading an arbitrary binary search as a binary search on a list -- a
random access list, as Louis noted correctly -- can do something for you:
class Element implements Comparable { /
If you forget to implement RandomAccess, you'll get a very subtle
performance bug.
Just because it's easy if you know how to do it doesn't make it easy for a
random developer to do correctly.
On Wed, May 15, 2024 at 3:21 PM Mateusz Romanowski <
romanowski.mate...@gmail.com> wrote:
> Hi,
> I woul
Hi,
I would say it is not worth any effort.
One can easily write an ad-hoc *local* adapter extending
`java.util.AbstractList`..
.. and immediately invoke existing `java.util.Collections::binarySearch`
method.
Cheers,
MR
On Thu, Apr 25, 2024 at 9:09 PM Pavel Rappo wrote:
>
>
> > On 25 Apr 2024,
On Thu, Apr 25, 2024 at 2:09 PM Pavel Rappo wrote:
>
>
> > On 25 Apr 2024, at 19:41, David Lloyd wrote:
> >
> > The JDK contains a few collection- and array-oriented implementations of
> binary search. For the most part, they all work the same way: search the
> target "thing" by index using the
> On 25 Apr 2024, at 19:41, David Lloyd wrote:
>
> The JDK contains a few collection- and array-oriented implementations of
> binary search. For the most part, they all work the same way: search the
> target "thing" by index using the obvious bisection strategy, returning
> either /index/ or