alg:change binary search function prototype to contain left and right index
alg:wrong termination in binary search for smallest element bigger than key
alg:variant of binary search,correct termination when searching smallest element bigger than key.