CS 3304 Fall 2000 Homework Assignment 2

50 Points
Due: Monday, September 11, at 5:00PM

The point value of each problem is shown in square brackets [ ]. Your solutions must be prepared with LaTeX or other word processing system and submitted as a stapled printout to a box outside the instructor's office (McBryde 638). This homework is due at 5:00PM on September 11, 2000. No late homework will be accepted. Complete each of the following problems and turn in your work:

  1. [25] Sebesta Chapter 14, Problem 4 (page 602).

  2. [25] Write a Scheme function atom-set-of that takes an S-expression as parameter and returns a list of all the atoms at any level of the S-expression, without repetitions.

    For example,

    (atom-set-of 'aabab)
    
    returns
    (aabab)
    
    while
    (atom-set-of '(a (b c) (a d) (d a c (b a) z)))
    
    returns
    (a b c z d)
    
    (the order of the atoms in the returned list is irrelevant).

    You may want to define auxiliary functions to simplify the main function.

     

copyright © 2000 Virginia Tech, ALL RIGHTS RESERVED
Last modified: October 25, 2000, 08:11:39 EDT, by Lenwood S. Heath <heath@cs.vt.edu>