Closed prashant-mahanta closed 5 years ago
It is already assigned. https://github.com/jainaman224/Algo_Ds_Notes/issues/610
@jainaman224 my approach is for strings and with a space complexity of O(n). The PR which is merged for longest common subsequence is for integer array with a space complexity of O(m*n).
@prashant-mahanta Is there any specific name to the algorithm?
@jainaman224 No, the Longest Common Substring is usually the problem called. It's the implementation difference, instead of a mn matrix we can keep a 2n matrix to reduce the space complexity(as we only need the adjacent rows only) from O(m*n) to O(n).
I want to add the Longest common substring algorithm which is commonly known as LCS in C++, Java, and Python. The Time complexity of the algorithm
O(n*m)
and Space complexityO(n)
using DP Link: Longest Common Substring_Wikipedia Can I go ahead with this?