00:01
Okay, so here we want to have an algorithm in pseudocode for producing the largest increasing or decreasing sub -sequence of a sequence of distinct integers.
00:08
So first, we can initialize to arrays increasing, so i and c increasing and d in d .c for decreasing with length n, where n is going to be the length of the input sequence.
00:28
And then second, for each element in the input sequence, we can do the following.
00:34
So first, we can initialize the index variable to the length of the current increasing sequence.
00:42
So initialize the index variable.
00:47
And then b, we start from the last element in the current increasing sequence.
00:53
We then compare the current element with each element in the sequence until the first element that is smaller than the current element is found...