Search an element in a sorted and rotated array | GeeksforGeeks

preview_player
Показать описание

This video is contributed by Harshit Jain.

Рекомендации по теме
Комментарии
Автор

you are just making a simple algo sophisticated by the way you explain

akshaydwivedi
Автор

can we have more vedios on DE Shaw interview preperation

tcobvaibhavwable
Автор

7:28 high < low can any one explain what does it actually mean?

amanjaiswal
Автор

Great Job Geeksforgeeks! this video is certainly not for the beginners, but for intermediate level programmers. The algorithm was very clearly demonstrated.

vaishnavigoteti
Автор

in the solution on last line return search(arr, l, mid - 1, key); -- is it required ?

sainathpatil
Автор

How can you pass 0 and n-1 as low and high and compare them with the mid where the array is pivoted in the first place?

pman-codes
Автор

Giving an example would definitely be better but your explaination is very good, much better than just reading the text. Thanks. Keep making such videos.

shwetadk
Автор

clear it with some examples ...reading algo we will do it ourselves, ,

raghavchadha
Автор

Why are we checking from first element to key element ?
How ??

satyamgupta
Автор

*This is what happens when you memorize*

subham-raj
Автор

You just read the algorithm that's it, there is no use of any of your videos. This is very disappointing from your side "geeksforgeeks"

akankshagupta
Автор

finding pivot will itself take O(n) in worst case, so i guess linear search will also be a considerable option

saikumarmadhadi
Автор

GfG should just give up this stuff. Extremely confusing

ragas_
Автор

finding pivot code is too complex. prone for an error. if traversing every element is O(n), use easier method to get a pivot.

spicytuna
Автор

So disappointing. Without explanation reading code line by one doesn't make any sense. Everybody can do it! You need to add clear explanations and examples.

alperozdamar
Автор

Isse Accha aap Hindi me explain kare to jada acche se samaj aayega

hemant_malav
Автор

while the array is sorted we don't have to do any search i think, here's a simple fun
int fun(int arr[], size_t t_size, unsigned int n)
{
if (n <= t_size / 2)return n==arr[(t_size / 2 + n)-1]?n:-1;
else if (n == t_size) return n==arr[t_size/2]?n:-1;
else return n == arr[(n - (t_size / 2)) - 1] ? n : -1;
}

karimfarhouti