0.0.2 • Published 8 years ago

permutate v0.0.2

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
8 years ago

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]

**********/