Homework 8
- Chapter 9, problem 5
- Chapter 10, problem 1
- Chapter 10, problem 6: The problem uses Java as the language to think
about. Since Java enforces variable initialization, the question doesn't make
sense. Use C or C++ which don't force you to initialize variables.
- Show how to construct the list ((x y) z) from the individual symbols
using only the cons operation.
- Evaluate each of the following expressions.
- (cdr '(a))
- (cdr '((a b c) x y z))
- (car '((a b c) x y z))
- (car (cdr '((hotdogs) (pickles) (mustard ketchup))))
- (car (car '((hotdogs) (pickles) (mustard ketchup))))
- (car (cdr (cdr '((hotdogs) (pickles) (mustard ketchup)))))
- In each of the following, you are going to apply the same operation to
take apart the given list. (op (op (op ... (op list)))) Show the
intermediate results if you want partial credit.
- How many times can you apply car before you get an atom from the list
((a b c) d e)?
- How many times would you have to apply cdr to the list ((b) (x y) ((c)))
before you get the empty list?
- Chapter 15, problem 6
This assignment can be turned in
- on paper (in class the day they are due)
- emailed to me (please use the address tcole@onyx.boisestate.edu)
with the assignment number in the subject and your name in
the text of the assignment.
- submitted using
submit tcole cs354 h8
Acceptable formats for electronically submitted assignments are text,
OpenOffice or MicrosoftWord. I should be able to open your assignment with
OpenOffice. Unless otherwise specified in the assignment, the entire
assignment should be in a single document named hwnnn with an appropriate
extension.