Programming Tutorial (C / Windows/ Prolog)
CLOUD COMPUTING | DATA MINING | ARTIFICIAL INTELLIGENCE | APPLICATION PROGRAMMING IN C/C++/Java
Wednesday, May 4, 2011
PROGRAM TO CALCULATE UNION OF 2 LISTS
gurpreet_union([X|Y],Z,W) :- member(X,Z), gurpreet_union(Y,Z,W).
gurpreet_union([X|Y],Z,[X|W]) :- \+ member(X,Z), gurpreet_union(Y,Z,W).
gurpreet_union([],Z,Z).
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment