For this lab, work through all of section 8.4 in the text, doing all of the exercises (8.18-8.29). As with the previous lab, you should work in groups of two, but we would prefer that you choose a different partner.
look-up-with-menu
. The remaining exercises
collectively culminate in procedure called values->trie
,
which allows you to construct a phone trie from a list of name/phone
number pairs.
We have constructed the following file:
/Net/solen/u8/Faculty/ek/karl/Public/MC27/trie.scmwhich contains all the relevant code from the book (including the
filter
procedure from chapter 7). You should copy it
over into your directory to get started.
Note that this file contains two separate definitions of
phone-trie
. One, which also appears in the book, uses the
values->trie
procedure to produce the trie. You won't be
able to use this definition until the very end of the lab, since you
won't have a working values->trie
until then. The other
definition is to be used in the meantime, so you can work with the
procedures that access tries before you have the procedure for
building them. This second definition simply defines
phone-trie
as a large quoted list structure.
After loading and evaluating this file, you should try out the
automated phonebook by evaluating the expression
(look-up-with-menu phone-trie)
. You can see the list of
names in the phone trie on pages 276-77 of the textbook.
Be sure to test the system at appropriate intervals and show your test
results. At the end of the lab, when you have values->trie
working, evaluate the book's definition of phone-trie
that uses
values->trie
and then make sure that everything else still
works.
Each group should write a single lab report, authored by both members of the group. As usual, write up a lab report that explains all of what you did to an audience generally knowledgeable about Scheme and such, but ignorant of specifically what you did. Answer all of the questions posed, but do not simply write up your lab as a sequence of exercises. Instead, try to convey the big picture of what you accomplished. Remember, there are some tips in the document entitled "Suggestions for clear lab reports in computer science courses."