diff --git a/Write a program to print all permutations of a given string b/Write a program to print all permutations of a given string new file mode 100644 index 0000000..c83c553 --- /dev/null +++ b/Write a program to print all permutations of a given string @@ -0,0 +1,44 @@ +// C++ program to print all +// permutations with duplicates allowed +#include +using namespace std; + + +// Function to print permutations of string +// This function takes three parameters: +// 1. String +// 2. Starting index of the string +// 3. Ending index of the string. +void permute(string a, int l, int r) +{ + // Base case + if (l == r) + cout<