recursion help

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.
Last edited on
I dont understand your "question" can you reword it please.

also, please explain if you MUST use recursion.

and please elaborate what "possibility" you want to print.

If you have any existing code, please post it too, make sure its in <code> tags using the format buttons to the right when editing your post.

@Jaybob66 edited
Topic archived. No new replies allowed.