in reply to Re: Special binary search
in thread Special binary search

This looks good, thanks!

Yes, two binary searches is what is needed. Once I find the two values bordering the window, I can then just run all the elements between them.

Fantastic! -- Bill P

Replies are listed 'Best First'.
Re^3: Special binary search
by sn1987a (Curate) on Jun 22, 2021 at 18:17 UTC
    Since you want all of the values within the window, there is no need to do two searches. Once you find one value in the window you can get sequential values, both higher and lower, until get the ends of the window.