You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2021/05/26 14:27:44 UTC
[GitHub] [commons-text] XenoAmess edited a comment on pull request #233: A More Efficient Implementation for Calculating Size of Longest Common Subsequence
XenoAmess edited a comment on pull request #233:
URL: https://github.com/apache/commons-text/pull/233#issuecomment-848815825
Hi.
Thanks for your pr.
The thought is correct, it can save memory from n*m to 2* Math.min(n,m) in this way.
As you refined this function, you can refine **public CharSequence longestCommonSubsequence(final CharSequence left, final CharSequence right)** as well.
use 3 numbers(a start-index and an end-index, and the length) to cache the dp
Of course you can also not cache the length but use start-index and end-index to calculate the length dynamically, but it need a jmh performance test to see whether way is better.
--
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:
users@infra.apache.org