Why is this binary search described as looking at an element's immediate left and right neighbors?

https://leetcode.com/explore/learn/card/binary-search/135/template-iii/936/

In the explore card for binary search for Template III the algorithm is given and the description states:

  • Search Condition needs to access element's immediate left and right neighbors
  • Use element's neighbors to determine if condition is met and decide whether to go left or right

I would have assumed this means the algorithm looks at nums[mid-1] and nums[mid+1] but it never does. What is meant by these bullet points if the algorithm is never actually looking at the immediate neighbors to mid and only comparing mid against the left and right bound?

Comments (0)