Pergunta de entrevista da empresa Oracle

Given a string, generate all the permutations of the string