How do I find the LIS,subsequence, with the constraint that I cant skip first and last element?
EDIT:
What I actually meant was that I have to start from the beginning and end at the end.Also I want to extend this for a zigzag subsequence like
Dynamic programming: Find longest subsequence that is zig zag
Implement the typical LIS algorithm, simply remove all elements smaller than the first element and bigger than the last one from the input. Only consider elements that are not the first or the last one for the solution and then append these two to the solution you find. Also in case the last element is no bigger than the first one say there is no increasing subsequence.