Question: Given a sequence, please design an algorithm that finds the longest decreasing subsequence. A subsequence ti is decreasing if for all i , ti >
Given a sequence, please design an algorithm that finds the longest decreasing subsequence. A subsequence ti is decreasing if for all i ti ti For example, if the input sequence is The longest decreasing subsequence is or The longest length is Your algorithm only needs to give the longest length. Bonus If your algorithm can also output the subsequence if there are multiple optimal solutions, print any of them you can get some bonus points.
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
