General Discussions

Generate Permutations – Decrease and Conquer

PH's avatarPH Bytes

Uses the definition of n! to generate the permutations.

Idea: Remove each item from the given n items one at a time and append it to remaining (n-1)! permutations.

Efficiency: O(n!) and as well we have expensive swaps

Strategy used: Decrease and Conquer(decrease by 1)

View original post

Let me Know What you Think!