1,801 views

2 Answers

0 votes
0 votes

Given Sequence is 22,5,7,2,23,10,15,21,3,17.

An increasing subsequence of maximal length are  {5, 7, 10 ,15, 21} and { 5,7,10,15,17} .

A Decreasing subsequence of maximal length are  {22, 5 , 2}, {22, 5, 3}, {22, 7, 2}, {22, 7, 3}, {22, 10, 3}, {23, 15, 3}, {23, 10, 3}, {23, 21, 3}, {23, 21, 17}.......

A Decreasing subsequence of maximal length is {22, 5, 2} or any one of the above.

edited by
0 votes
0 votes

Increasing subsequence: {5, 7, 10, 15, 17}

Increasing subsequence: {5, 7, 10, 15, 21}

Decreasing subsequence: {23, 21, 17}

Decreasing subsequence: {22, 21, 17}

Decreasing subsequence: {23, 10, 3}

Decreasing subsequence: {23, 15, 3}

Decreasing subsequence: {22, 10, 3}

Decreasing subsequence: {23, 15, 3}

there are many decreasing sub sequence possible..

max Increasing subsequence=5

max Decreasing subsequence=3

Related questions

0 votes
0 votes
0 answers
1
admin asked Apr 29, 2020
434 views
There are $51$ houses on a street. Each house has an address between $1000\: \text{and}\: 1099,$ inclusive. Show that at least two houses have addresses that are consecut...
0 votes
0 votes
0 answers
3