CSC104H1 Lecture 7: Exercises for Week 11

68 views5 pages

Document Summary

; a. (define (a x) (cond [(list? x) (apply + (map a x))] Function nested list item . (map a (list b c): (list (a b) (a c), (list 1 1) [hide (map a (list b c))] (apply + (map a (list b c)))) (apply + (map a (list b c)): (apply + (list 1 1), (+ 1 1, 2. [hide a] (map a (list a (list b c)))) (map a (list a (list b c)): (list (a a) (a (list b c)), (list 1 2) #;(b (list 0 (list (list 1 2) 3 4))) (list 2 1 3 4 0) Lll) (+ (length lll) (apply + (map c lll)))] [hide (d 3) (d 4) (d (list 5 6))] (d (list 3 4 (list 5 6)))) Function list of list of number . #;(e (list (list 1 (list 2 3)) (list 4 5))) (list (list 5 4) (list (list 3 2) 1))

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Questions