
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The instructions and problems for homework 4 of the csci 169 - software paradigms course offered by the george washington university's department of computer science in the fall of 2007. Students are required to complete problems related to reversing lists in scheme, including writing a deep-reverse function and explaining the behavior of a given mystery function.
Typology: Assignments
1 / 1
This page cannot be seen from the preview
Don't miss anything!

The George Washington University School of Engineering and Applied Science Department of Computer Science CSci 169 – Software Paradigms – Fall 2007 Homework #
Due Date: Monday, December 3, 2007
Instructor: A. Bellaachia
Problem 1: (20 points) Do problem 2 on page 330 of your textbook.
Problem 2: (20 points) Do problem 3 on page 330 of your textbook.
Problem 3: (20 points) The Scheme function reverse described in the lecture reverses only the “top level” of a list: If L =((2 3) 4 (5 6)) then (reverse L) will return ((5 6) 4 (2 3)). Write a Scheme function deep-reverse that also reverses all sub-lists: (deep-reverse L) will return ((( 6 5) 4 (3 2)).
Problem 4: (20 points) What does the following scheme function do? Explain.
Problem 5: (20 points) Write a Scheme function that tests for the structural equality of two given lists. Two lists are structurally equal if they have the same list structure, although their atoms may be different.