Common LISP: A Gentle Introduction to Symbolic Computation (Dover Books on Engineering) by David S. Touretzky

Common LISP: A Gentle Introduction to Symbolic Computation (Dover Books on Engineering) by David S. Touretzky

Author:David S. Touretzky [Touretzky, David S.]
Language: eng
Format: epub
Publisher: Dover Publications
Published: 2014-02-19T23:00:00+00:00


EXERCISES

8.18. Use single-test tail recursion to write LAST-ELEMENT, a function that returns the last element of a list. LAST-ELEMENT should recursively travel down the list until it reaches the last cons cell (a cell whose cdr is an atom); then it should return the car of this cell.

Figure 8-2 Template for single-test tail recursion.

8.19. Suppose we decided to convert ANYODDP to single-test tail recursion by simply eliminating the COND clause with the NULL test. For which inputs would it still work correctly? What would happen in those cases where it failed to work correctly?



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.