A binary search is supposed to divide the size by 2 each time
It also assumes that the list is sorted (if it isn't a binary search will randomly fail/pass)
So
Code:
else if (item < *list)
// Call ourself for the lower part of the array
return binarySearch(item, list, listSize - 1);
else
// Call ourself for the upper part of the array
return binarySearch(item, list, listSize + 1);
Should be something like
Code:
int mid = (listSize) / 2; // compute mid point.
if (item == list[mid])
return list[mid]; // found it.
else if (item < list[mid])
// Call ourself for the lower part of the array
return binarySearch(item, list, listSize/2);
else
// Call ourself for the upper part of the array
return binarySearch(item, list+mid, listSize/2);