my attempt to do the exercises in sicp.

Saturday, March 13, 2010

sicp exercise 3.26


;; Exercise 3.26.  To search a table as implemented above, one needs to scan through the list of records. This is basically the unordered list representation of section 2.3.3. For large tables, it may be more efficient to structure the table in a different manner. Describe a table implementation where the (key, value) records are organized using a binary tree, assuming that keys can be ordered in some way (e.g., numerically or alphabetically). (Compare exercise 2.66 of chapter 2.)

;; each subtable of the table can be made like a binary tree. the search procedure 'assoc' shall be replaced by binary seach procedure 'lookup' as in exercise 2.66

;; shall post the detailed answer later


No comments: