CS60A FALL 1993 Midterm 2 * Do not turn the page until instructed to do so. * This exam contains fivenumbered pages including tbe cover page. Put all answers on these pages, please; don't hand in stray pieces ofpaper. * This is an open book exam. * If, after the exam, you compare your answers with those of yourfriends, do not panic if their answers were different from yours. Their questions were probably different.Except for this first page, you do not have the same exam pages as your neighbors. * This exarn is worth 20points, or 10% of your total course grade. The exam contains four substantive questions, plus the following:Question 0 (1 point): Fill out this front page correctly and put your name and login correctly at the top of eachof the following pages. Question 1 (4 points): The published solution (homework 5) for deep-reverse issurprisingly short. It is (define (deep-reverse l) (if (atom? l) l (mapcar deep-reverse (reverse l)))) Here areother attempts to program tbe same function. (define (deep-reverse2 l) (if (list? l)(reverse (mapcar(deep-reverse2 l))) l)) (define (deep-reverse3 1) (if (list? l) (reverse (mapcar deep-reverse3 l)) l)) (define(deep-reverse4 l) (if (list? 1)(deep-reverse4 (mapcar reverse l)) l)) What will Scheme print when you try use
This is the end of the preview.
access the rest of the document.