added code and algorithm explanation for binary search