Given an array you have to print the longest bitonic subsequence from the array. A bitonic sequence is a sequence where numbers of that sequence are sorted and they are increasing first then decreasing
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
For this sequence:
Longest increasing subsequence from front:
Longest increasing subsequence from rear:
After add up:
Therefore, the length of the longest bitonic subsequence is 5.
Therefore, the numbers from the first LIS are: 1 7
Therefore, the numbers from the second LIS are: 3 2 1
Therefore, the sequence will be 1 7 3 2 1
C++ implementation:
Output