search in rotated array