Skip to content

Previous/Next Permutation #404

Closed
@czgdp1807

Description

@czgdp1807

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/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions