Programming Languages (CSC-302 99S)

Exam 1: Language Design, Functional Programming, and Scheme

This page may be found online at

Distributed: Friday, February 12, 1999
Due: Start of class, Friday, February 19, 1999
No extensions!

There are two questions on the exam, each with an equivalent point value. You must do both problems. Note, however, that the different questions are not necessarily of the same complexity or length.

This examination is open book, open notes, open mind, open computer, open Web. Feel free to use any and all resources available to you except for other people. As always, you are expected to turn in your own work. If you find ideas in a book or on the Web, be sure to cite them appropriately.

This is a take-home examination. It is likely to take you about four hours. You may use any time or times you deem appropriate to complete the exam, provided you return it to me by the due date. No late exams will be accepted. I will make a solution key soon after the exam.

Because different students will be taking the exam at different times, you are not permitted to discuss the exam with anyone until after I have returned it. If you must say something about the exam, you are allowed to say ``This is definitely the hardest exam I have ever taken.'' You may also summarize these policies.

Answer all of your questions in a blue book or electronically. That is, you may write all of your answers on the computer and print them out. If you write your answers in the blue book, you need not do the problems in order (but it would help me if you provided a table of contents). If you type your answers on the computer, please do them in order.

I will give partial credit for partially correct answers. You ensure the best possible grade for yourself by highlighting your answer and including a clear set of work that you used to derive the answer.

I may not be available at the time you are taking the exam. If you feel that a question is badly worded or impossible to answer, note the problem and attempt to reword the problem in such a way that it is answerable. If it's a reasonable hour (before 10 p.m. and after 8 a.m.), feel free to try to call me in the office (269-4410) or at home (236-7445).

I will also reserve time at the start of classes next week to discuss any general questions you have on the exam.

In some questions, you may be asked to write code. You must write working code and demonstrate to me that you have tested the code.

1. The Design of Scheme

Evaluate Scheme using the criteria of simplicity, extensibility, and safety, as well as two other criteria of your own choosing. Your evaluations should be sufficient to convince me that you understand (1) the meaning of each criterion; (2) Scheme; and (3) how the two relate. You should not restrict your discussion to what you've learned in class. Often, you will need to refer to the Scheme report for further information.

Make sure that you choose interesting criteria.

2. Quicksort

Write a tail-recursive version of Quicksort in Scheme using continuation-passing-style. You are not permitted to use an explicit stack. Your Quicksort function should take the comparison operation as a parameter.

You may recall writing Quicksort for assignment 2. Obviously, this is a slightly different version.

In case you've forgotten, the basic structure of Quicksort is

In the array-based version of Quicksort, you build the two sublists using a pivot function. In the list-based version, you may have to find a slightly different way to build the two sublists.

Disclaimer Often, these pages were created ``on the fly'' with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.

This page may be found at

Source text last modified Fri Feb 12 13:08:00 1999.

This page generated on Wed Feb 17 10:27:15 1999 by SiteWeaver. Validate this page's HTML.

Contact our webmaster at