search insert position

two method, one ordinary and the other one using binary search. but the
time cost of binary search is not always better than the other one.