%add(X,L,L1).
%adds element X to the beginning of the list L and returns L1
add(X,L,[X|L]).
%add(X,L,L1)
%adds element X to the end of the list L and returns L1
add(X,[],[X]).
add(X,[A|L],[A|L1]):-
add(X,L,L1).
Email this
Hits: 2551
Comments (0)

Write comment


