This problem can be addressed using dynamic programming and recursion. Start by defining the base case: if the input list contains only one element, the permutation is simply that element. For each additional element, insert it into every possible position within all permutations of the remaining elements. Below is an example of a Python solution. def getPermutations ( array ) : permutations = [ ] permutationsHelper ( array , [ ] , permutations ) return permutations def permutationsHelper ( array , currentPermutation , permutations ) : if not len ( array ) and len ( currentPermutation ) : permutations . append ( currentPermutation ) else : for i in range ( len ( array ) ) : newArray = array [ : i ] + array [ i + 1 : ] newPermutation = currentPermutation + [ array [ i ] ] permutationsHelper ( newArray , newPermutation , permutations ) In this implementation, the getPermutations function serves as the primary entry point, initializing the output and temporary data structures, and invoking the helper function, permutationsHelper . This helper function recursively generates permutations by selecting an element from the input list and adding it to the current permutation. The subsequent recursive calls are made with new lists that exclude the chosen element.