def binary_search(arr, key):
	"""
		binary seach using iterative method
	"""
	first = 0
	last = len(arr)-1
	found = False

	while first <= last and not found:
		mid = (first + last) // 2
		if arr[mid] == key:
			found = True
		else:
			if arr[mid] > key :
				last = mid -1
			else:
				first = mid + 1
	return found