Skip to content

erictrinh/lcs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published