2014-10-09

posted Oct 9, 2014, 4:49 AM by Samuel Konstantinovich   [ updated Oct 9, 2014, 4:49 AM ]
Draw a box diagram for the lists below:
'(1 9 3 2)
'(7 5 4 6)

Lists can contain other lists
Examples:
e1.  '( a b ( c d ) e f)  is a list with 5 top level elements, 4 of them are atoms, 1 is a list.
e2.  '( 1 (2 3) (4 5) ) is a list with 3 top level elements, 1 of them is an atom, 2 are lists.
e3.  '( (a b (c d) e f) ) is a list with 1 top level element that is a list. This list contains the list from example 1.

These can also have box diagrams! (See notes from board)
'(a b (c d) e)

Draw a box diagram for the following lists:
L. '(a (b) (c d) e)
M.  '(a (b c) (d e) )
N.  '(a (b (c d) e) f)

Now write a scheme expression with car/cdr that you use on List N to: 
1. extract the b.
2. extract the e.
3. extract the d.
Comments