This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: (cons (listlast lst) (cons (length lst) lst))) (define (superlist-car suplst) (caddr suplst)) (define (suplist-length suplst) (cadr suplst)) (define (suplist-last suplst) (car suplst)) Question 5. (define (adds-to-n? n lst) (cond (( = n 0) true) ((null? lst) false) (else (or (adds-to-n? (- n (car lst)) (cdr lst)) (adds-to-n? n (cdr lst))))). ..) Question 6. Part a: Summer 2003 CS61A Midterm 1 Solu 2 What does (split 'abc) return? ====> (a b) On which line number is the bug that causes this error? =====> 5 What should the fixed line say?=======> (cond ((empty? wd) (se cur)) Part b: There is another bug. On which line is this bug? ======> 6 What should the fixed line say? =======> ((equal? (first cur) (first wd)) Summer 2003 CS61A Midterm 1 Solu 3...
View Full 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.
- Fall '08
- Computer Programming