De Bruijn sequence javascript generator
A javascript implementation of the de Bruijn sequence algorithm
Exemple :
const { deBruijn } = require('de-bruijn-js-generator');
let generator = deBruijn(10, 8);
let value = generator.next().value;
while (value != undefined) {
value = generator.next().value;
console.log(value);
}
Methods
The only method provided is call deBruijn
it take three arguments :
k
is the alphabet (as an array) or the max digit (excluded)n
is the length of the codes
is optional (false by default), if true the entire code will be returned at every iterations
Install :
npm install de-bruijn-generator