MASSACHVSETTS INSTITVTE OF TECHNOLOGY Depart ment of Electrical Engineering and Computer Science 01-Structure and Interpret at ion of Computer Programs Spring Semester, 2005 Quiz it NAME: Sample Solutions Part 1:(25 points) Question 1 (define (rotate-left cycle) (cdr cycle)) Question 2: (define (rotate-right cycle) (define (aux where start (if (eq? (cdr where)start) where Caux (cdr where) start))) (aux cycle cycle)) Question 3: (define (insert-cycle! new cycle) et ((new-cell (list new )) (set-cdr! new-cell cycle) (set-cdr! (rotate-right cycle) new-cell) 'done)) Question 4 (define (delete-cycle! cycle) (set-cdr! (rotate-right cycle)(rotate-left cycle) set-cdr! cycle’( done) Part 2: (30 points !""# $% %& '""( )