If you are using the array just as a set of values, i.e. you need three operations: adding a value to the set, deleting a value and checking if the value is in the set, you can use a hash instead of a sorted array. En equivalent of the binary search algorithm is inside the implementation of hashes - so you can use it for free, with no effort.