Generate All Permutations of a String Write a program to generate all permutations of a given string.