lcp

1.1.0 • Public • Published

LCP - Longest Common Prefix

Computes the longest common prefix for strings using a Trie

API

var LCP = require('lcp')
var lcp = new LCP(['fooseball', 'foobar', 'foam'])
lcp.addWord('foobar')
lcp.lcp() // 'fo'

or if you don't like classes

LCP.findLCP(['fooseball', 'foobar', 'foam']) // 'fo'

Readme

Keywords

Package Sidebar

Install

npm i lcp

Weekly Downloads

134

Version

1.1.0

License

MIT

Last publish

Collaborators

  • addisonj