## CSci 4651 Problem set 2.

### All textbook problems are in section 2.9

#### Problem 1: Textbook problems

• Problem 1 p. 107 (2 points)
• Problem 3 p. 107 (3 points)
• Problem 6 p. 108 (6 points)
• Problem 7 p. 108, write down your explanation (step by step) of what happens (4 points)
• Problem 8 p. 109 (4 points)
• Problem 9 p. 109 (6 points)
• Problem 11 p. 110 (5 points)
• Problem 13 p. 110 (5 points)

#### Problem 2 (5 points)

Write a tail-recursive function in Oz that takes a list (and possibly other parameters to make it tail-recursive) and returns the length of the list.

#### Problem 3 (5 points)

Write a tail-recursive function in Oz that takes a list of numbers that has at least one element and returns the smallest element in the list. The function must raise an exception takingMinOfAnEmptyList if given an empty list. Do not handle any other error cases.

#### How to submit

Submit your file(s) to me by e-mail. The subject must be Problem Set N, where N is the problem set number.
Handwritten problems can be scanned and attached (good quality scanning, please!) or submitted in class or in my office in person. If submitting handwritten work, please clearly write your name and problem set number on it.

The views and opinions expressed in this page are strictly those of the page author. The contents of this page have not been reviewed or approved by the University of Minnesota.