0.1.0 • Published 5 years ago
mtrie v0.1.0
trie
Use trie to implement 'search array by the specified prefixed-string'.
// Big array
const data = [
'abc hello',
'hello world',
'Wow that'
// ...
]
// The matching string
const str = 'ab'
// Buid trie tree
const tree = trie.generateTrie(data)
// The matched array
const r = trie.matchString(tree, str)
0.1.0
5 years ago