alg:binary search,time complexity of O(log(N))