CS 3304 Homework Assignment 5

25 Points
Due: 10/11 at the start of class

Note: The following instructions are repeated from the Homework Dates/Guidelines page:

Your solutions for each homework assignment must be prepared with a word processor (e.g., LaTeX or Word), and are due at the beginning of class on the due date specified unless otherwise noted on the assignment itself.

Note that all homework problems taken from the text are in the Problem Sets. Do not turn in solutions to Review Questions by mistake!

Complete each of the following problems:

  1. Write your own implementation of the Scheme built-in function list-head:

    (list-head list k)

    Returns a newly allocated list consisting of the first k elements of list. K must not be greater than the length of list.

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

  2. Chapter 5, Problem 11 (pp. 215-216 of 5E text, in 4E: Chapter 4, Problem 11 on pp. 191-192)

  3. Chapter 5, Problem 14 b, e, and f (p. 217 of 5E text, in 4E: Chapter 4, Problem 14, b, e, and f, on pp. 193-194)