How can we search in rotated sorted array which contains duplicate elements? Ex: 1, 1, 3, 1 and target = 3
Searching in rotated sorted array with duplicate elements
@17uec133 It doesn’t look possible to search in O(Logn) time in all cases when duplicates are allowed. It is not possible to decide whether to recur for left half or right half by doing constant number of comparisons at the middle. So in this case, do a linear search.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.