Finding partial substrings within a string?

€“ David Titarenco (from comment) If you want LCS of arbitrary number of strings its NP-hard. But it the number of input strings is constant ( as in this case, 2) this can be done in polynomial time.

Looking at your sole example it looks like you want to find longest common subsequence. Take a look at LCS Is it just me, or is this NP-hard? €“ David Titarenco (from comment) If you want LCS of arbitrary number of strings its NP-hard.

But it the number of input strings is constant ( as in this case, 2) this can be done in polynomial time.

1 +1 good answer :) – David Titarenco Sep 20 '10 at 3:44 This isn't right. Given OP's example input, it would return 'ABCDFG' – aaronasterling Sep 20 '10 at 4:04 @Aaron: You'll have to modify the algorithm a bit to find the actual substring that contributed to the answer. But the basic idea remains very much the same.

– codaddict Sep 20 '10 at 5:23 Thanks, I'll look into modifying an LCS algo – Peter Chang Sep 20 '10 at 12:14.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions