algorithms-js icon indicating copy to clipboard operation
algorithms-js copied to clipboard

Implemented longest common subsequence algorithm

Open wbira opened this issue 6 years ago • 1 comments

I want partially resolve #8 by adding implementation of Longest common subsequence

wbira avatar Oct 16 '18 16:10 wbira

Hi, tests that you've written only check response value's length. Once I changed them to check an acctual algorithm result one of tests doesn't pass.

it('should find baba or abab for abaabbaaa and babab', () => {
    const stringA = 'abaabbaaa';
    const stringB = 'babab';

    const result = logestcommonsubsequence(stringA, stringB);
    assert.equal(['baba', 'abab'].indexOf(result) !== -1, true);
  });

I guess the problem is in your readSolution function. Let me know If you want to work on this. If the answer is negative. I'll be more than happy to fix this :)

remes2000 avatar Jul 19 '20 13:07 remes2000