Computer Science 61A - Fall 2000 - Harvey - Midterm 1

# Computer Science 61A - Fall 2000 - Harvey - Midterm 1 - CS...

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

CS 61A, Midterm #1, Fall 2000 CS61A, Fall 2000 Midterm #1 Professor Brian Harvey Problem #1 (5 points): What will Scheme print in response to the following expressions? If an expression produces an error message, you may just say “error”; you don’t have to provide the exact text of the message. If the value of an expression is a procedure, just say “procedure”; you don’t have to show the form in which Scheme prints procedures. (let ((a 3) (b 4)) (lambda () (+ a b))) (let ((a 3) (b 4)) ((lambda () (* a b)))) (every - (filter number? ‘(the 1 after 909))) ; EVERY from homework 2 For the following, also draw a box and pointer diagram of the value produced by each expression. (cons ‘(a b) (list ‘(c d) ‘e)) (cddar ‘((a b c) (d e f) (g h i))) Problem #2 (2 points) file:///C|/Documents%20and%20Settings/Jason%20Raft. ..-%20Fall%202000%20-%20Harvey%20-%20Midterm%201.htm (1 of 4)1/27/2007 6:28:47 PM

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

View Full Document
CS 61A, Midterm #1, Fall 2000 (a) Indicate the order of growth in time of foo below: (define (foo n) (if (< n 2) 1 (+ (baz (- n 1)) (baz (- n 2)) ) )) (define (baz n)
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 4

Computer Science 61A - Fall 2000 - Harvey - Midterm 1 - CS...

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

View Full Document
Ask a homework question - tutors are online