Question: Let A be an array of length n containing real numbers. A longest increasing subsequence ( LIS ) of A is a sequence 0 <
Let A be an array of length n containing real numbers. A longest increasing subsequence
LIS of A is a sequence i i i n so that Ai Ai Ai
so that is as long as possible. For example, if A then an LIS is
i i i i corresponding to the subsequence Notice that a
longest increasing subsequence does not need to be unique In the following parts, we
will walk through the recipe that we saw in class for coming up with DP algorithms to
develop an Ontime algorithm for finding an LIS.
a bonus pointsIdentify optimal substructure and a recursive relation
ship We will come up with the subproblems and recursive relationship for you,
although you will have to justify it Let Di be the length of the longest increasing
subsequence of A Ai that ends on Ai Expain why
Di max
k Dk : k i Ak Ai
Provide a short informal explanation. It is good practice to write a formal
proof, but this is not required for credit
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
