{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CS61A_fa98_f

# CS61A_fa98_f - CS 61A Final December 16 CS 61A Final Your...

This preview shows pages 1–3. Sign up to view the full content.

CS 61A Final - December 16, 1998 Your name login cs61a- This exam is worth 30 points, or about 21% of your total course grade. It contains ten questions. This booklet contains eight numbered pages including the cover page. Put all answers on these pages, please; don't hand in stray pieces of paper. This is an open book exam. When writing procedures, don't put in error checks. Assume that you will be given arguments of the correct type. Question 1 (2 points): In the twenty-one project, which of the following are higher-order procedures? Check all correct answers. ___ (best-value hand) ___ (stop-at-17 my-hand dealer-card) ___ (play-n strategy n) ___ (stop-at n) ___ (majority strat1 strat2 strat3) Question 2 (2 points): (define (foo x) (if x (foo #f) 5)) (define (baz x) (and x (baz #f) 5)) What is the value of (foo 3) ? What is the value of (baz 3) ? Question 3 (2 points): In question 2 above, one of the procedures foo and baz generates a recursive process; the other generates an iterative process. Which is which, and in one English sentence , explain why. Your name login cs61a- Question 4 (2 points): Here is a transcript of a Scheme session. Fill in the blanks. (It will help if you draw a box and pointer diagram first.) CS 61A Final --- December 16, CS 61A Final - December 16, 1998 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
> a (1 2 (3 4 5) 6) > b (1 2 3 4 5) > c (1 2 (3 4 5) 6) > (eq? (cddr b) (caddr a)) #T > (eq? (caddr c) (caddr a)) #F
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

CS61A_fa98_f - CS 61A Final December 16 CS 61A Final Your...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online