练习 2.24

表达式 (list 1 (list 2 (list 3 4))) 的打印结果如下:

1 ]=> (list 1 (list 2 (list 3 4)))

;Value 11: (1 (2 (3 4)))

它的盒子图形如下:

 (1 (2 (3 4)))       ((2 (3 4)))
[*]---------------> [*]
 |                   |
 |                   |
 v                   v (2 (3 4))         ((3 4))
 1                  [*]---------------> [*]
                     |                   |
                     |                   |
                     v                   v (3 4)             (4)
                     2                  [*]---------------> [*]---------------> '()
                                         |                   |
                                         |                   |
                                         v                   v
                                         3                   4

它的树图形如下:

 (1 (2 (3 4)))
   *
  / \
 /   \  (2 (3 4))
1     *
     / \
    /   \  (3 4)
   2     *
        / \
       /   \
      3     4

讨论

blog comments powered by Disqus