An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0:n-1] is given below. Let Li denote the length of the longest monotonically increasing sequence starting at index i in the array. Initialize Ln-1 = 1. For all i such that 0 i n-2 Li = cases 1 + Li+1 & if A[i] < A[i+1] \\ 1 & Otherwise cases Finally the length of the longest monotonically increasing sequence is Max(L0, L1, , Ln-1). Which of the following statements is TRUE?
Topic-wise GATE CS PYQs with verified steps
