find the minimal element in a sorted and rotated array