Computer Science 61A - Spring 1997 - Harvey - Midterm 1

# Computer Science 61A - Spring 1997 - Harvey - Midterm 1 -...

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

CS 61A CS 61A, Spring 97 Midterm 1 Professor Harvey Problem #1 (7 points): What will Scheme print in response to the following expression? If an expression produces an error message or runs forever without producing a result, 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. Assume that no global variables have been defined before entering these expressions, except where noted. (se '(+ 2 3) (+ 2 3)) ((lambda (x y z) (+ x 5)) 6 7) ; from ex. 1.32, p. 61 (accumulate se 0 (lambda (x) x) 3 (lambda (x) (+ x 1)) 5) ((if 3 - *) 23 2) (a b c) (let ((a 5) (b (+ a 3))) (* a a)) ((lambda (f) (f f)) (lambda (f) f)) Problem #2 (2 points): True or false? A theta( nlog(n)) algorithm is, for all large enough n, slower than a theta ( n^2) one. _____ For small size inputs the theta order of an algorithm helps predict running time. _____ Function f below defines a linear iterative process: file:///C|/Documents%20and%20Settings/Jason%20Raft...20Spring%201997%20-%20Harvey%20-%20Midterm%201.htm (1 of 3)1/27/2007 6:28:48 PM

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern