hey guys. i was given a project today in my C++ class. The directions are as follows:
A. solicit from the user a positive integer n.
B. Generate and display a list of all the possible permutations of the first n integers.
in other words, the user inputs 3, the program spits out
123
132
213
231
312
321
now i dont want someone to post a full source code to this, id like to work on it myself, but im kinda stuck right now. i was wondering if someone could point me in the right direction as to what the recursive step might be.
i know that we have to use recursion (possibly more than one recursive function) and vectors (i think four of them) throughout the code. and i think the base case should look something like this (correct me if im wrong):
if (n==1)
{
(some code)
return 1;
}
any help would be greatly appreciated.