ali-ghanbari opened a new pull request #233: URL: https://github.com/apache/commons-text/pull/233
Existing implementation for the method `apply` from the class `LongestCommonSubsequence` calls the method `longestCommonSubsequence` from the class which is quadratic in time and space and it involves unnecessary string manipulation operations. **Since the method `apply` is intended to calculate the size of Longest Common Subsequence (LCS), we do not need the whole 2D dynamic programming table nor we do need to calculate the actual LCS to take its length**. This pull request proposes a direct solution for the problem of finding the size of LCS: The idea is that if we are only concerned with calculating the size of LCS, we can implement a space efficient dynamic programming solution where we keep track of only the last two rows. Please see [https://www.ics.uci.edu/~eppstein/161/960229.html](url) for more information. Thank you. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
