Course Solutions Uncategorized (Solved) : 15 Pts Implement Assoc Idea Alist Association List Fundamental Scheme Lisp Simplest Possib Q30557144 . . . .

(Solved) : 15 Pts Implement Assoc Idea Alist Association List Fundamental Scheme Lisp Simplest Possib Q30557144 . . . .

 

(15 pts) Implement assoc The idea of an alist (for association list) is fundamental to Scheme/LISP, and is the simplest possible implementation of a dictionary ADT built out of simple cons lists (c.f. map in C+ STL). An alist must be a list of cons pairs, for instance > (define e ((a 1) (b 2) (c 3))) The Standard Library procedure assoc has the following form assocobj <alist>) It finds the first pair in <alist>whose car field is <obj>, and returns that pair. If no pair in <alist» has <obj> as its car, then o (not the empty list) is returned Note that assoc is required to use equal? to compare <obj> with the items in <alist>. For example > (assoc a e) (a 1) >(asseS b (b 2) (assoç d e) (assoC 5 (2 3) (5 7) (11 13))) (5 7)

(15

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post