Given a sequence of numbers you have to find out the length of the longest increasing odd even subsequence and print the length of the subsequence
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)
Let N be the number of elements say, X1, X2, X3 ... Xn.
Let odd(a) = the value at the index a of the odd array and even(a) = the value at the index a of the even array.
To find the length of the longest increasing odd even subsequence we will follow these steps,
odd (index of current element) = even (index of the comparing element) + 1 ;
even (index of current element) = odd (index of the comparing element) + 1;
C++ Implementation:
Output
need an explanation for this answer? contact us directly to get an explanation for this answer