<p>Although in the general case you cannot do better than O(log N), you can at least optimize that, thus significantly reducing the constant of proportionality in front of O(log N).</p>

<p>If you have to perform multiple search on the same array, these can be vectorized using SIMD extensions, thus further cutting down on computation cost.</p>

<p>In particular, if you are dealing with arrays of floating point numbers which satisfy certain properties, than there are ways to construct a special index which then allows to search the array in O(1).</p>

<p>All of the above aspects are discussed with test results in:
<a href="https://arxiv.org/abs/1506.08620" rel="nofollow noreferrer" title="Cannizzo, 2015, Fast and Vectorizable Alternative to Binary Search in O&#40;1&#41; Applicable to a Wide Domain of Sorted Arrays of Floating Point Numbers">Cannizzo, 2015, Fast and Vectorizable Alternative to Binary Search in O(1) Applicable to a Wide Domain of Sorted Arrays of Floating Point Numbers</a>
The paper comes with source code on <a href="https://github.com/fabiocannizzo/FastBinarySearch" rel="nofollow noreferrer">github</a>.</p>
Faster than binary search for ordered list
<p>is there an algorithm that is faster than binary search, for searching in sorted values of array?</p>

<p>in my case, I have a sorted values (could be any type values) in an <code>A</code> array, I need to return <code>n</code> if the value I was looking is in range of <code>A[n] and A[n+1]</code></p>