0

Hello All,

I came across a question wherein I need to find an element in the array.However, it's given that the array has been rotated many number of times and initially the array elements were sorted in an increasing order.I just wanted to know what is meant by rotating an array? Does it mean simply changing order of the elements or it implies something else? I know this might be a stupid question to ask.

Thanks.

4
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by ChPravin
0

I assume it means shifting all the elements one place to the right with the last element in the array wrapping around to be the first element in the array with every rotation.

0

When I use the term, it means what aspire1 said, except that you can shift the elements N places, for some value of N.

Either way, "many rotations" gets the same meaning, and the combined effect of many rotations is the same as that of one of rotation, or a small number of aspire1's variety.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.