midterm-W08

# midterm-W08 - University of Waterloo CS 136 Midterm Exam...

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

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

View Full Document

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.

Unformatted text preview: University of Waterloo CS 136 Midterm Exam Winter 2008 CS 136: Elementary Algorithm Design and Data Abstraction Instructor: Prabhakar Ragde March 3, 2008 Start time: 7:00 PM. End Time: 9:00 PM. Duration: 120 minutes Number of exam pages (including this cover sheet): 13 Closed book (UW-supplied calculators okay) Name: Student Number: Signature: # Points Possible Score Comments 1 10 2 10 3 15 4 10 5 10 6 10 7 10 8 8 Total 83 Mark 100 Directions Write your name and student ID number on every page. If you need extra paper for a question, use the back of that question’s page. 1 Name: Student Number: Name: Student Number: Name: Student Number: 1. (10 Points) Write Scheme code to bind uwcs and vendetta to values as represented by the following box-and-pointer diagrams. (a) [5 points] 135 133 125 136 134 uwcs (b) [5 points] vendetta 2. (10 Points) Draw the box-and-pointer diagrams that represent the results of evaluating the follow- ing Scheme code. (a) [5 points] ( define a ( cons empty empty )) ( define b ( cons a a )) ( define c ( list b a )) (b) [5 points] ( define x ( cons 1 ( cons 2 empty ))) ( define y ( cons 3 ( cons 4 empty ))) ( set-first! x ( rest y )) ( set-rest! y x ) CS 136 2 CS 136 2 CS 136 2 Name: Student Number: Name: Student Number: Name: Student Number:...
View Full Document

## This note was uploaded on 10/02/2011 for the course CS 136 taught by Professor Becker during the Spring '08 term at Waterloo.

### Page1 / 4

midterm-W08 - University of Waterloo CS 136 Midterm Exam...

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

View Full Document
Ask a homework question - tutors are online