Given an array of distinct integers. Print all possible permutations of that array. Example: [1,2,3] Answer : [1,2,3] ; [1,3,2] ; [2,3,1] ; [2,1,3] ; [3,1,2] ; [3,2,1]
Sigiloso
There is N! (N, the size of the array) possibilities and you can resolve this problem with recursion. (Same kind of question in Cracking the Coding Interview)