CS 3304 Fall 2001 Homework Assignment 3

25 Points
Due: 9/19/01 at the start of class

Complete each of the following problems:

  1. Write a Scheme function that returns the intersection of two simple list parameters that represent sets.

  2. Chapter 15, Problem 2 (p. 627 of 5E text, in 4E: Chapter 14, Problem 2 on p. 602):

  3. Write your own implementation of the Scheme built-in function sublist:

    (sublist list start end)

    Returns a newly allocated list formed from the elements of list beginning at index start (inclusive) and ending at end (exclusive). You may assume that start and end are integers that satisfy:
         0 <= start <= end <= (length list)
    

    Name your function my-sublist, since sublist is already provided as a standard operation in Scheme (you may not use sublist, list-head, or list-tail in your solution).

copyright © 2001 Virginia Tech, ALL RIGHTS RESERVED
Last modified: November 30, 2001, 09:18:59 EST, by Stephen H. Edwards <edwards@cs.vt.edu>