CS61A_fa94_mt1 - CS61A: Midterm #1-Fall 1994 CS61A, Fall...

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

View Full Document Right Arrow Icon
CS61A, Fall 1994 Midterm #1 Question 1 (3 points): What will Scheme print in response to the following expressions? Assume that they are typed in sequence, so definitions affect later interactions. 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. (lambda (x y) x) (* (+ 2 3) (+ 2 6)) (first '(help!)) ((word 'but 'first) 'plop) (let ((+ -) (- +)) (- 8 2)) ((lambda (z) (- z z)) (random 10)) Question 2 (1 point): Check off all of the following problems that can be solved in linear time: (a) Find the largest of a sentence of numbers. (b) Find out whether a sentence contains two equal words (for example, the sentence (the cat in the hat) contains the twice). (c) Find out whether or not all the words in a sentence are equal. Question 3 (5 points):
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 11/23/2010 for the course CS 61A taught by Professor Harvey during the Fall '08 term at University of California, Berkeley.

Page1 / 2

CS61A_fa94_mt1 - CS61A: Midterm #1-Fall 1994 CS61A, Fall...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online