CSci 4651 Problem set 2.

Due Monday, February 22nd at 11:59pm (by e-mail)

45 points

All textbook problems are in section 2.9

Problem 1: Textbook problems

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.


CSci 4651 course web site.