The language used here is in Racket. Please explain what is the code doing and the meaning of each line. (define intersect (lambda (set1 set2) (cond ((null? set1)(quote ())) ((member (car set1) set2)...


The language used here is in Racket. Please explain what is the code doing and the meaning of each line.


(define intersect
(lambda (set1 set2)
(cond
((null? set1)(quote ()))
((member (car set1) set2)
(cons (car set1)
(intersect (cdr set1) set2)))
(else (intersect (cdr set1) set2)))))


(intersect '(1 2 3) '(3 2 1))
(intersect '(1 2 3) '(4 5 6))
(intersect '(1 2 3) '(2 3 4 5 6))



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here