in this method if we want to print the elements of the longest subsequence
will the order get changed?
for example-
input
1 5 2 4 6 3
output will be
1 2 3 6
and it should be
1 2 4 6
in this method if we want to print the elements of the longest subsequence
will the order get changed?
for example-
input
1 5 2 4 6 3
output will be
1 2 3 6
and it should be
1 2 4 6
please elaborate your doubt ?im not able to understand your question
i mean to say that in this binary search method
if we want to print the dp array containing longest subsequence for input=1 5 2 4 6 3 output will be 1 2 3 6 but normally it should be 1 2 4 6 this method will count the longest subsequence correctly but will this print the longest subsequence correctly?