Question: (Sublinear-time algorithm design) Given an array of integers, an element is a peak if it is not smaller than its two adjacent elements. Devise a
(Sublinear-time algorithm design) Given an array of integers, an element is a peak if it is not smaller than its two adjacent elements. Devise a sublinear-time algorithm to find such a peak element. For instance, for a given input of {10,20,15,2,23,90,67}, your algorithm should return either 20 or 90. Hint: Use a variant of binary search algorithm.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
