This question evaluates proficiency in fundamental search algorithms, specifically binary search implementation, array indexing, handling first-occurrence semantics and integer overflow considerations while requiring both iterative and recursive forms.
Implement binary search on a sorted integer array without using any library helpers. Return the index of the first occurrence of the target or -1 if absent. Provide both iterative and recursive versions, handle potential integer overflow in midpoint calculation, and analyze time and space complexity.