Answer
Increasing : {5,710,15,21}
Decreasing : {22,5,2}
Work Step by Step
Given sequence is {22, 5, 7, 2, 23, 10, 15, 21, 3, 17.}
We want to find increasing and decreasing sequence of maximum length.
Increasing sequence of maximal length is {5,710,15,21}.
For decreasing sequence of maximal length many answers are possible.
{22,5,2}, {22,5,3},{22,7,2},{22,10,3}, {22,15,3}, {23,10,3}, {23,15,3}, {23,21,3},{23,21,17}