The language used here is in Racket. Please explain what is the code doing and the meaning of each line. (define (subset? L1 L2) (cond ((null? L1) #t) (else (if (not (member? (first L1) L2)) #f...


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


(define (subset? L1 L2)
(cond
((null? L1) #t)
(else (if (not (member? (first L1) L2)) #f (subset? (rest L1) L2)))))


(subset? '(1 2 3) '(3 2 1))
(subset? '(1 2 3) '(4 5 6))
(subset? '(1 2 3) '(1 2 3 4 5 6))
(subset? '(1 2) '())



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here