Infineon Technologies interview question

Print all the permutations of a array.