how do you print all the permutations of a string when:
1)assume all characters are distinct .
2)can have duplicate characters

i know how to do it recursively:
example string is abc
permutations are:
a + (permutations of bc)
b + (permutations of ac)
c + (permutations of ab)

ne better way ?