search in rotated sorted array 2

improved binary search, but in worst case, it maybe O(n)