Domanda di colloquio di Microsoft

Given an input string, write an efficient program that will print all of it's permutations.