def binary_search(alist, item):
  """
  Iterative Binary Search.
  O(log(n)) time complexity.
  :type alist ordered values.
  :type the item to find.
  :rtype True or False if item is in list.
  """
  left = 0
  right = len(alist) - 1

  # iterate while left index isn't
  # greater than the right index.
  while left <= right:
    # determine the midpoint of the list.
    mid = (left + right) // 2
    # check if midpoint is the item
    if alist[mid] == item:
      return True
    # search the left half if item 
    # is smaller than the midpoint
    if alist[mid] > item:
      right = mid - 1
    # search the right half if item
    # is greater than the midpoint.
    elif alist[mid] < item:
      left = mid + 1
  # item is not in the list.
  return False