l = -1; u = n while l + 1 != u m = (l + u) /2 /* целочисленное деление */ if x[m] < t l = m else u = m p = uif p >= n || x[p] != t p = -1