yashvardhan-rustedlegend / Peak-Elements-in-the-array-

Given an array of integers. Find a peak element in it. An array element is a peak if it is NOT smaller than its neighbors. For corner elements, we need to consider only one neighbor.

Repository from Github https://github.comyashvardhan-rustedlegend/Peak-Elements-in-the-array-Repository from Github https://github.comyashvardhan-rustedlegend/Peak-Elements-in-the-array-

Peak-Elements-in-the-array-

Given an array of integers. Find a peak element in it. An array element is a peak if it is NOT smaller than its neighbours. For corner elements, we need to consider only one neighbour.

Example:

Input: array[]= {5, 10, 20, 15} Output: 20 The element 20 has neighbours 10 and 15, both of them are less than 20.

About

Given an array of integers. Find a peak element in it. An array element is a peak if it is NOT smaller than its neighbors. For corner elements, we need to consider only one neighbor.


Languages

Language:C++ 100.0%