I’m a little bit confused. How is the problem of generating permutations in Lexicographic Order any different from the problem of sorting? Can someone please explain it to me with an example? Thanks
I’m a little bit confused. How is the problem of generating permutations in Lexicographic
Share
These are two different things. There are
N!permutations, but there is only one sorted order (the sorted permutation is the smallest lexicographically).Here is an example of a sorted permutation:
Here is a list of permutations in lexicographic order:
Here is a program in C++ to generate permutations in lexicographic order: