Generic binary search, and specific search for a missing element in an array