input: Write a python function to implement an iterative binary search.
  assert binary_search_iterative([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0, 9, 5) == 4
  assert binary_search_iterative([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0, 9, 1) == 0
  assert binary_search_iterative([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0, 9, 10) == 9
  assert binary_search_iterative([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], 0, 9, 11) == -1
output: def binary_search_iterative(arr, left, right, x):
      while left <= right:
          mid = left + (right - left) // 2
          if arr[mid] == x:
              return mid
          elif arr[mid] < x:
              left = mid + 1
          else:
              right = mid - 1
      return -1