Assignment 5

Assignment 5 - CS 136 Fall 2009 Kate Larson Assignment 5...

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

View Full Document Right Arrow Icon
CS 136 Fall 2009 Kate Larson Assignment 5 Due Tuesday, October 27, 2009, 10pm Language level : Module (full PLT Scheme). The last three questions involve programming in C. To submit : a5q1.txt , a5q2.txt , my-reverse2.ss , my-reverse2-driver.ss , pattern.c , pattern-driver.c , binary.c , binary-driver.c , reverse-binary.c and reverse-binary-driver.c 1. One implementation of the function append is as follows: ;; Contract: my-append: (listof any) (listof any) (listof any) ;; Purpose: Produces result of appending lst2 to lst1 ( define ( my-append lst1 lst2 ) ( cond [( empty? lst1 ) lst2 ] [ else ( cons ( first lst1 ) ( my-append ( rest lst1 ) lst2 ))])) Let N be the length of lst1 . Analyze the running time of my-append in terms of N . To submit: a5q1.txt 2. One implementation of the function reverse is as follows: ;; Contract: my-reverse: (listof any) (listof any) ;; Purpose: Produces the result of reversing lst ;; ( define ( my-reverse lst ) ( cond [( empty? lst ) lst ] [ else ( append
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 10/21/2010 for the course CS 136 taught by Professor Becker during the Fall '08 term at Waterloo.

Page1 / 3

Assignment 5 - CS 136 Fall 2009 Kate Larson Assignment 5...

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