Package Exports
- typescript-algos
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (typescript-algos) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Typescript-algos
This is an mit licensed library of data structures written in typescript. Feel free to use it, or submit pull requests if you want to add functionality, tests, or new data structures.
The most interesting data structure in the library is Aho-Corasick which is very efficient at matching words in input text from a static dictionary. (If n is the length of text, and m is the total number of matches Aho-Corasick finds all matches in O(n + m) time). For very large dictionaries this is quite efficient. My implementation of AhoCorasick optionally allows for splitting the creating and building of the Aho-Corasick state machine with requestAnimationFrame so that user experience is not affected. The data structure can be serialized with cycle safe libraries such as flatted but only for small numbers of patterns (approximately 1000 in testing).
Installation
npm install typescript-algos
Usage
import { LinkedList } from "typescript-algos";
const linkedList = new LinkedList([...Array(10).keys()]);