Given an array of integers, I need to return a new array containing the middle element(s) from the original array. Specifically, the result will have one element if the length o
int mid = firstIndex + (lastIndex-firstIndex)/2 , will give you the mid of the array.
int mid = firstIndex + (lastIndex-firstIndex)/2