Search in rotated sorted array

Is there any other approach possible for this problem apart from binary search which we can discuss if this question is asked in an interview ?

hello @nidhigupta847
u can solve this problem using.
linear search,
hashing,
or
u can first find pivot of the array . and then apply binary search in required size

1 Like

If we do it by hashing, will a set do or we’ll require a map ?

if u want to print index of the key then use map.
otherwise if u just want to check the presence then set will also work fine

1 Like