{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Computer Science 61A - Spring 1999 - Harvey - Midterm 2

Computer Science 61A - Spring 1999 - Harvey - Midterm 2 -...

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

View Full Document Right Arrow Icon
CS 61A, Midterm #2, Spring 1999 CS 61A, Spring 1999 Midterm #2 Professor Brian Harvey Question 1 (4 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. Also, draw a box and pointer diagram of the value produced by each expression. (cons '(a b) '(( c d))) (cdadr '((1 2 3) (4 5 6) (7 8 9))) (cons (list '(a) '(b)) (list 'c 'd)) (cons '(a b) 'c) file:///C|/Documents%20and%20Settings/Jason%20Raft...20Spring%201999%20-%20Harvey%20-%20Midterm%202.htm (1 of 5)1/27/2007 6:29:50 PM
Background image of page 1

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

View Full Document Right Arrow Icon
CS 61A, Midterm #2, Spring 1999 Question 2 (5 points): A three-tree is a tree-like structure in which each node contains two values, called the left-datum and the right-datum , and up to three children, called the left-branch , the middle-branch , and the right- branch . (Any of these can be an empty list instead of a three-tree.)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}