Question: needs to be done in scheme (15 pts) Implement assoc The idea of an alist (for association list) is fundamental to Scheme/LISP, and is the

needs to be done in scheme needs to be done in scheme (15 pts) Implement assoc The

(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 ) It finds the first pair in whose car field is , and returns that pair. If no pair in as its car, then o (not the empty list) is returned Note that assoc is required to use equal? to compare with the items in . For example > (assoc 'a e) (a 1) >(asseS b (b 2) (asso 'd e) (assoC 5 (2 3) (5 7) (11 13))) (5 7)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!