You can do better than O (log n) if the values are integers, in which case the best worst-case execution time you can achieve, from the point of view of n, is O (sqrt (log n)). Otherwise, there is no way to beat O (log n) if there are no patterns in the input sequence. There are two approaches used to extract O (log n) in the case of integers.
y-fast , , - , . , . , O (log w), w - . , , (. ).
-, , , w ^ O (1) , O (log n/log w).
, log w = sqrt (log n), O (sqrt (log n)).
. 12 13 : http://courses.csail.mit.edu/6.851/spring07/lec.html