delete([],A,[]).
delete([H|T],A,Result) :- H=A, delete(T,A,Result).
delete([H|T],A,[H|Result]) :- delete(T,A,Result).
Output
delete([a,b,c,a],a,X) X=["b","c"]
X=["b","c","a"]
X=["a","b","c"]
X=["a","b","c","a"]
4 Solutions
Design By Manish and Ranjan
2 comments:
Thank you!
Can I use this code for a homework assignment??? will cite oc
Post a Comment