i am not able top do this problem.
pls tell the code.
Maximum length bitonic subsequence
@yutikakhanna hey,ye problem Longest increasing subseq ka extension hai ,ye logic lga kr socho and try kro agr nhi ho than I will provide you code:
Let the input array be arr[] of length n. We need to construct two arrays lis[] and lds[] using Dynamic Programming solution of LIS problem. lis[i] stores the length of the Longest Increasing subsequence ending with arr[i]. lds[i] stores the length of the longest Decreasing subsequence starting from arr[i]. Finally, we need to return the max value of lis[i] + lds[i] – 1 where i is from 0 to n-1.
pls tell in the form of a code.
@yutikakhanna hey ,you can refer to this code ,it has comments also:
Just dry run it you will get it.
all the testcases are showing wrong answer in this given code
@yutikakhanna hey don’t submit it directly apko change krna pdega input ko ,kyunki isme initialise krke array lia,input loop khud lgani pdegi.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.