midterm-W08

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

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
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 questions 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

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 Right Arrow Icon
Ask a homework question - tutors are online