Netherworld's Pretend Minibar
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

permutate

0.0.2 • Public • Published

permutate

NodeJS implementation of next permutation from lexicographic order of an array, a'la Narayana Pandita in 14th century India.

Sample Usage

var permutate = require('permutate');

var seq = [1,2,3]; 
while(seq) {
	console.log(seq);
	seq = permutate.next(seq);
}

/**********  outputs :


[1, 2, 3]
[1, 3, 2]
[2, 1, 3]
[2, 3, 1]
[3, 1, 2]
[3, 2, 1]

**********/

install

npm i permutate

Downloadsweekly downloads

6

version

0.0.2

license

Apache-2.0

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar