Like opening a dictionary to the exact middle rather than checking every page.
Start with the full sorted array. left points to the first element, right to the last.
> arr: [2,5,8,12,16,23,38,56,72,91] > left=0 right=9 target=23
Like opening a dictionary to the exact middle rather than checking every page.
Start with the full sorted array. left points to the first element, right to the last.
> arr: [2,5,8,12,16,23,38,56,72,91] > left=0 right=9 target=23
Sign in to cast your vote
Sign in to share your feedback and join the discussion.