input: Write a function to implement binary search on a sorted array and determine if a given value exists in the array. The function should return True if the value is found, otherwise return False. If the array is empty, the function should return False.
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 5)==True
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 8)==False
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 1)==True
  assert binarySearch([1, 2, 3, 4, 5, 6, 7], 7)==True
  assert binarySearch([], 5)==False
output: def binarySearch(arr, target):
      left, right = 0, len(arr) - 1
      while left <= right:
          mid = (left + right) // 2
          if arr[mid] == target:
              return True
          elif arr[mid] < target:
              left = mid + 1
          else:
              right = mid - 1
      return False