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