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]

**********/

Readme

Keywords

Package Sidebar

Install

npm i permutate

Weekly Downloads

1

Version

0.0.2

License

Apache-2.0

Last publish

Collaborators

  • purplecabbage