[Home] [Syllabus] [Assignments] [Resources]

This page contains problem set assignments for the course. The assignments will be added as they become available.- Problem set 1. Due Monday, January 30th at 8pm in my office (or by e-mail). Problems 2.1, 2.2, 2.3 pp. 16-17.
- Problem set 2. Due Wedn., Feb 8th at 8pm (in my office or by e-mail). Here is the starting code for this problem set.
- Problem set 3. Due Wedn., Feb 15th at 8pm (in my office or by e-mail).
- Problem set 4. Due Friday, Feb. 24th, at 8pm.
- Problem set 5. Due Fri., March 17 at 8pm (in my office or by e-mail). Here is the starting code for this problem set. Also, Here is the lab (in class, March 13th)
- Problem set 6. Due Wedn., March 29th at 8pm (in my office or by e-mail).
- Problem set 7. Due Mon., April 10th at 8pm (in my office or by e-mail).
- Problem set 8. Due Wedn., April 19th at 8pm (in my office or by e-mail).
- Problem set 9. Due Wedn., May 5th at 8pm (in my office or by e-mail).

- Lab 1. Define and test the following Scheme functions:
`swap`

takes a single argument. If it is an atom (i.e. not a pair), it just returns the argument. If it's a pair, it switches the car and the cdr. For instance:`(swap (cons 5 8)) >(8 . 5) (swap '(2 3 4)) >((3 4) . 2) ; Why? (swap 5) > 5`

`deep-swap`

is a recursive version of swap: it recursively swaps all cons-cells in the arguments. Test this function carefully. What happens if it's applied to a list?*Guess*what happens when it's applied as follows:

Now try it. Is that what you expected? Can you explain the results?`(define x (cons 3 4)) (define y (cons x x)) (deep-swap y)`

- Type in the following definition:

What is z? Test it. How can we get the result of the expression, given z?`(define z (cons + '(2 3)))`

- Lab on generics
- Lab on C++
- Lab on Java bytecode