I have a question that I still struggle with. It would be really appreciated if you guys could give me some hints.
Here is the problem : Assume that $a[1\dots n]$ is an array of $n$ positive real numbers. Let $\alpha >0$ and $\beta >0$
a subarray $a_1$ with $m$ elements of $a[1 \dots n]$ is called increasing if $\frac{a_1[i]}{a_1[j]}\geq \alpha$, for all $i>j$ and $1 \leq i, j \leq m$.
a subarray $a_2$ with $k$ elements of $a[1 \dots n]$ is called decreasing if $\frac{a_2[i]}{a_2[j]}\leq \beta$, for all $i>j$ and $1 \leq i, j \leq k$.
Question : write a program to find all increasing/decreasing subarrays of $a[1 \dots n]$ ? thanks so much for your help.