CS 136 Tutorials - Spring 2007

CS 136 Home » Tutorials » Tutorial 2: Service Managers and Destructive Methods »

Solution for first semantics example

The part of the code marked in green is the part which is about to be expanded, and the part marked in red is the part which was just expanded.

  First Next
(define-struct node (ssn name left right))
(define node1 (make-node 5 'Tingting false false))
(define node2 (make-node 1 'James false node1))
(set-node-ssn! node1 6)