Skip to content
RED SAGSkills
medium10 pts · first answer countssorting-and-searching

Single value among pairs in a sorted array

In a sorted array where every value appears twice except one, such as [1, 1, 2, 3, 3, 4, 4], a binary search keeps mid even and compares a[mid] with a[mid + 1]. If they are equal, what should it do?

Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions