Onet Interview Question

Write algorithm for getting permutations of n element set.