i want to print n length array where i want to swap index starting from 1 to n element with every other index element.
for eg A={1,2} if i=1 then i can replace it with index 1 or 2 i.e {1,2} and {2,1}. After that i==2 then again two possibilities index 1 or 2 i.e {2,1};{1,2};{1,2};{2,1}. so i need to print last level nodes.