| Description |
Binary Search operates by dividing an array in half, and then determining whether or not the target value would be in the larger or smaller half. Then, this process repeats by dividing whichever half must contain the target in half again, over and over until the target is found.
Construct a function that performs binary search on a given array and returns the index of the target value if it is found in the array. Assume that the target will be in the array (in other words, do not handle the case where the target does not exist in the array). |