Peter den Haan
posted 15 years ago
That depends on the number of elements you are searching through; once the number exceeds a certain threshold binary search will aways be faster. By the way, before you start hand-coding it look into TreeSet, TreeMap, Collections.binarySearch(), and Arrays.binarySearch(), all of which can be used to implement binary (n*log(n)) searches.Originally posted by leon matthew:
Is it faster to do a binary search recursively than to just code a full search?