Question: IN PROLOG write a predicate called intersect(L1,L2). intersect(L1,L2) if there is at least one element that appears in both the lists L1 and L2. For
IN PROLOG write a predicate called intersect(L1,L2). intersect(L1,L2) if there is at least one element that appears in both the lists L1 and L2. For example: intersect([2,4,8,10],[9,8,7,6]) is true. intersect([aster,bluebell,carnation],[daisy,eglantine,fennel]) is false.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
