Question: Can you Solve the question in C without using Vector (std::vector), just array. A peak element is an element that is greater than its neighbors.
A peak element is an element that is greater than its neighbors. Given an input array, find all peak elements and print the biggest and smallest element. You may imagine that num[-1] num[n]. For example, in array [1, 2, 3, 3, 2, 4, 1, 5, 6, 3, 1, 10, 2, 8], the peak elements array is [4, 6, 10, 8] 1. The biggest value of peak elements is 10. 2. The smallest value of peak elements is 4. Code box: #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
