arr [ i ] wants to be a potential candidate of future subsequence It will replace ceil value in tailIndices
else : NEW_LINE INDENT pos = GetCeilIndex ( arr , tailIndices , - 1 , leN - 1 , arr [ i ] ) NEW_LINE prevIndices [ i ] = tailIndices [ pos - 1 ] NEW_LINE tailIndices [ pos ] = i NEW_LINE DEDENT