arr [ i ] wants to be a potential condidate of future subsequence It will replace ceil value in tailIndices
int pos = GetCeilIndex ( arr , tailIndices , - 1 , len - 1 , arr [ i ] ) ; prevIndices [ i ] = tailIndices [ pos - 1 ] ; tailIndices [ pos ] = i ; } } Console . Write ( " LIS ▁ of ▁ given ▁ input " ) ; for ( int i = tailIndices [ len - 1 ] ; i >= 0 ; i = prevIndices [ i ] ) Console . Write ( arr [ i ] + " ▁ " ) ; Console . WriteLine ( ) ; return len ; }