Interactive problem

http://dm.compsciclub.ru/app/quiz-local-maximum
Any ideas on how to solve this problem?

peak finding algorithm ( works only if there is a single peak == meaning only a single integer that satisfies that condition ( greater than its neighbors ) )
Go to the middle – select any two -> ignore the side which has smaller number --> you now have n/2 intergers --> go to the middle and do the same
Here is a lecture on peak finding algo by MIT - https://www.youtube.com/watch?v=HtSuA80QTyo&list=PLUl4u3cNGP61Oq3tWYp6V_F-5jb5L2iHb

1 Like

Yeah got it, thanks!

1 Like