
I need help doing a prolog multi-insert!!!
Im a student at University of Cincinnati, and I need help with an assignment.
I need to do the permutations of a list and part of the permutation relations
is a sub relation which i will call multiinsert, what it does is this:
it takes an atom (eg 'a') and inserts it into all the possible locations in a
list (eg. list=[1,2,3]--> [a,1,2,3],[1,a,2,3],[1,2,a,3],[1,2,3,a])
I just cant seem to get it,
ive tried to use length and then to count the number of elements but i can seem
to get that to work.
If you dont want to tell me the solution could you at least give me a hint...
Thanks, Brad
reply to me by email if possible.