I have an array of sorted ints with a 1,000 or more values (could be up to 5000+). I need to write a function that receives an int and returns a bool based on the element being in the array. I know I can write a for loop with a break, I know I can use jquery .InArray.
What would be the best way to implement this, KNOWING that the array is sorted.
Thanks.
Knowing that the array is sorted a binary search would be the best approach.