Your name:
________ __________
| | | | | /|
| o | --|----->| o | / |
|_|_|___| |__|__|/__|
| |
| |
BILL HILLARY
your answer should be (list 'bill 'hillary)
or simply '(bill hillary).
________ __________
| | | | | /|
| o | --|----->| o | / |
|_|_|___| |__|__|/__|
| |
| |
________ __________
| | /| | | /|
| o | / | | o | / |
|_|_|/__| |__|__|/__|
| |
| |
X Y
________________
| |
_|______ __________
| | | | | | /|
| o | --|----->| o | / |
|___|___| |__|__|/__|
|
|
X
________ __________
| | | | | /|
| o | --|----->| o | / |
|_|_|___| |__|__|/__|
| | |
| | |
|___| X
three-times
that takes a list of atoms (which may be empty), and returns a new list of
the same length, where each element in the new list is a list of length
three, with the original element occurring three times. (If you did
assignment 2 this should be easy!) Examples:
three-times function
tail-recursive? Why or why not?
It isn't tail recursive, since there is a call to cons that
takes the result of the recursive call and augments it. (This is an
example of augmenting recursion.)
three-times that uses the built-in
applicative operators rather than recursion. Don't define any
auxiliary functions using defun.
sum-of-squares that takes a list of numbers and returns the
sum of their squares. (For simplicity it doesn't do error checking.)