basic version
find function to find the rotated pivot with O(lgn) time