Implementation of a binary search three.