Since "ABCDEF"
has 6 characters, the number of permutations = 6! = 720
.
Here’s a C# program to generate and print them:
🔹 How it works:
-
Uses recursion to generate all permutations.
-
Swaps characters, calls recursively, then backtracks to restore the original order.
-
Stores all unique permutations in a
List<string>
.
🔹 Sample Output:
👉 This prints all 720 unique permutations of "ABCDEF"
.
No comments:
Post a Comment