in ‘Chiluvuru’ village there are many mathematicians and algorithm experts. They are always playing with numbers. In that village there is a young student and his name is Bahubali. He is interested in sorting algorithms. So, he taken a sorted array of n elements which has been circularly shifted. For example, {20,25,1,5,10,15} is a sorted array that has been circularly shifted by 2 positions. He want to find the largest element in a circularly shifted array. Here, there is a small constraint that the number of positions through which it has been shifted is unknown. He confuse to get a time complexity, so, try to help him to find time complexity.

1.

O(nlogn)

2.

O(logn)

3.

O($n^2$)

4.

O(n)

@Shaik Masthan

U mean it is left shift, yes great then

But if shift also unknown.

I mean this example $5,4,3,1,7,8$

In this case ??

I have found the solution

https://www.geeksforgeeks.org/maximum-element-in-a-sorted-and-rotated-array/

$O(log n)$

40 Points

11 Points

8 Points

4 Points

3 Points

2 Points

1 Points

152 Points

78 Points

48 Points

16 Points

15 Points

13 Points

12 Points

10 Points