Implementation Considerations
How will you pass “half of A” to the recursive calls to BinSearch?
- Pass entire array but send also the limits for the search.
- For example, BinSearch(A, First, Mid -1, Value);
How do you determine which half of the array contains Value?
- Test of equality and comparison between MidValue and Search Value.
- For example, if (Value < A[mid])
What should the base case(s) be?
- First > Last (termination without finding)
- Value == A[Mid] (Found Search Value)