Apply binary search algorithm (#739)

Apply binary search algorithm (#739)

Repeatedly halve sorted array to find target element.