Skip to content
erictrinhPublic

About

A Javascript implementation of the LCS algorithm

Resources

Stars

2 stars

Watchers

1 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Longest Common Subsequence in JS

This is an implementation of an algorithm to solve the longest common subsequence problem in Javascript.

Install

This is a node module, so install it with npm install erictrinh/lcs

Usage

var LCS = require('lcs');

var lcs = new LCS('abc', 'acd');

// length of the longest common subsequence
lcs.getLength(); // 2

// get the longest common subsequences (there may be more than one)
lcs.getSequences(); // [ 'ac' ]

// get the table generated by the algorithm
// see http://en.wikipedia.org/wiki/Longest_common_subsequence_problem
lcs.getTable();

About

A Javascript implementation of the LCS algorithm

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages