I am looking for an implementation of a O(log n)
array search algorithm.
The array is numeric and sorted [[1,2],[3,5],[4,5],...]
. Because it's a on mouse over
user interaction it needs to be super fast. The function should get the first array element to search and return the second of the found element. I can implement recursive quicksearch myself, but what existing solutions are out there? Is the Array.find
somehow efficient for instance?
Edit: I tried binary trees for instance, but the lag is still noticeable.