Category
Sorted array to perform binary search on
The function used to determine what direction to continue searching
The value of the first element in the array that satisfies the provided testing function. Otherwise, undefined
is returned.
Array
Perform a binary search to find an element in a sorted array.
Time complexity: O(log n)
Space complexity: O(1)