Question: All of this is in Common LISP Define a function to build a list of integers from 1 to n, then write a function to
All of this is in Common LISP
Define a function to build a list of integers from 1 to n, then write a function to create a list of combinations of pairs of integers. You can use either n as the input or the list of integers as input.
This would look like ((1 1) (1 2) (1 3) (2 1) (2 2) (2 3) (3 1) (3 2) (3 3)) for n = 3.
Then use this function on itself to get a list of all possible permutations.
The new resultant list from entering the previously created list would look like:
((1 1) (1 1) (1 2) (1 2) (1 3) ( 1 3) (2 1)... etc for n = 3
It would be very helpful if you wrote comment lines, explaining important lines of code, as well as variables/input labels.Help would be much appreciated!
Help would be much appreciated!
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
