Hi,
I want to add an element in the head of a list, for instance:
add(a,[b,c],N). N= [a,b,c].
But I'm too stupid, I don't know how to start with the easy case, when the list is empty. I thought of add(A,[],[A]). I think it is wrong, because at the end of a recursive list A will stand at the end(N= [b,c,a]) , and I don't want this.
Can somebody help?
I want to add an element in the head of a list, for instance:
add(a,[b,c],N). N= [a,b,c].
But I'm too stupid, I don't know how to start with the easy case, when the list is empty. I thought of add(A,[],[A]). I think it is wrong, because at the end of a recursive list A will stand at the end(N= [b,c,a]) , and I don't want this.
Can somebody help?