Closed
Description
Description of the problem
We should add previous and next permutation algorithm to pydatastructs
. A good place to add it will be miscellaneous_data_structures.algorithm
.
Example of the problem
Following is the interface of the above algorithm in my mind,
previous_perm(sequence) -> Output will be a sequence
next_perm(sequence) -> Output will be a sequence
next_perm([1, 2, 3]) -> [1, 3, 2]
References/Other comments
[1] http://www.cplusplus.com/reference/algorithm/next_permutation/
[2] http://www.cplusplus.com/reference/algorithm/next_permutation/