We are given an array of integers and a range, we need to find whether the subarray which falls in this range has values in the form of a mountain…
We are given an array of integers and a range, we need to find whether the subarray which falls in this range has values in the form of a mountain or not. All values of the subarray are said to be in the form of a mountain if either all values are increasing or decreasing or first increasing and then decreasing. Write a C/C++ Program that shows input is a Mountain sequence or Not Mountain sequence.
From the Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary exam, question 80 of 86.
More from this paper
- Previous: Topological sorting for Directed Acyclic Graph (DAG) is a linear ordering of vertices such that for every directed edge u → v, vertex u…
- Next: Given n jobs with starting times n[] and durations d[], print the maximum number of jobs that don't overlap with each other.
- All questions in Combined Bank Assistant Programmer (CSE) March 2021 – Preliminary