So I have this function I need to create which in addition to a binary search must do some data mining (so not a pure binary search)/
CustomBinarySearch(int goal, int[] myArray)
I know quite clearly how to go about making a binary search. The problem stems from the signature of the function. I would normally pass the index values of the sub-array as I recursively call it but I am required to maintain the original signature.
Is there any way to pass a sub-segment of an array without creating a new array? I am trying to be efficient with my code.
aka something like CustomBinarySearch(goal, myArray[startIndex, endIndex])?