3460:430/530 Theory of Programming Languages Fall 2005
Dr. C.-C. Chan Due: 11/20/05
Project #4 (30 pts)
Problem: Write the
following lisp functions
(mymerge '(1
3 5 7) '(2 4 6)) returns (1 2 3 4 5 6 7)
Don't use the built-in merge, sort, or insert
functions. The merge time should be
proportional to the length of the longer of the two lists.
6. Write a lisp function sumset that
takes a positive integer N and a list of positive integers L, determine if
there is any set of elements in L whose sum is N. If there is, return a list of those elements;
if not, return nil. For example,
(sumset 21 '(5
7 12 3 8)) returns nil
(sumset 20 '(5 7
12 3 8)) could return (5 12 3),
(5 7
8), or (12 8)
Notes:
You must use the same function names as
given in the problems indicated by boldface names.
Submissions:
1. Name your
source file “YourLastName.lisp”.
2. Send the
source file by e-mail to sk39@uakron.edu and chan@cs.uakron.edu
3. The project
is due by midnight of the due day.