Question: 3. 20 pts. Given an integer array, design a dynamic programming algorithm to find the length of the longest increasing sub-array. The elements of the

3. 20 pts. Given an integer array, design a dynamic programming algorithm to find the length of the longest increasing sub-array. The elements of the sub-array should be consecutive in the main array. Make sure your algorithm does not compute the sub-problems which had been computed before. Example: Input: [1,4,5,2,4,3,6,7,1,2,3,4,7] Output: 5 (the sub-array is [1,2,3,4,7] ) Example: Input: [1,2,3,4,1,2,3,5,2,3,4] Output: 4 (the sub-array is [1,2,3,4] or [1,2,3,5] ) PS: Printing the sub-array is not mandatory
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
