Recursive function to find the length of the longest subsequence of pairs whose first element is increasing and second is decreasing
public static int longestSubSequence ( int [ , ] A , int N , int ind , int lastf , int lasts ) { ind = ( ind > 0 ? ind : 0 ) ; lastf = ( lastf > 0 ? lastf : Int32 . MinValue ) ; lasts = ( lasts > 0 ? lasts : Int32 . MaxValue ) ;