Algorithms: Implementation of binary search