binarySearch(A, n, target)begin low ← 0; high ← n-1 while low ≤ high do mid ← (low + high) / 2 if A[mid] = target then return mid else if A[mid] < target then low ← mid + 1 else high ← mid - 1 return -1 // not foundend