mirror of
https://github.com/correl/sicp.git
synced 2024-11-23 11:09:57 +00:00
Fixup 1.2 work
This commit is contained in:
parent
82a90ac228
commit
54cfe3ef33
1 changed files with 7 additions and 6 deletions
11
1-2.org
11
1-2.org
|
@ -84,13 +84,13 @@ layout: org
|
||||||
|
|
||||||
#+BEGIN_SRC scheme
|
#+BEGIN_SRC scheme
|
||||||
(A 1 10)
|
(A 1 10)
|
||||||
24
|
1024
|
||||||
|
|
||||||
(A 2 4)
|
(A 2 4)
|
||||||
536
|
65536
|
||||||
|
|
||||||
(A 3 3)
|
(A 3 3)
|
||||||
536
|
65536
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
Consider the following procedures, where `A' is the procedure
|
Consider the following procedures, where `A' is the procedure
|
||||||
|
@ -113,7 +113,8 @@ layout: org
|
||||||
--------------------------------------------------------------------
|
--------------------------------------------------------------------
|
||||||
|
|
||||||
`(f n)' computes 2n
|
`(f n)' computes 2n
|
||||||
`(g n)' computes ...
|
`(g n)' computes 2^n
|
||||||
|
`(h n)' computes 2^h(n - 1)
|
||||||
|
|
||||||
* 1.2.2: Tree Recursion
|
* 1.2.2: Tree Recursion
|
||||||
|
|
||||||
|
@ -189,7 +190,7 @@ layout: org
|
||||||
(define (pascal row column)
|
(define (pascal row column)
|
||||||
(cond ((= column 1) 1)
|
(cond ((= column 1) 1)
|
||||||
((= row column) 1)
|
((= row column) 1)
|
||||||
(#t (+ (pascal (- row 1) (- column 1))
|
(else (+ (pascal (- row 1) (- column 1))
|
||||||
(pascal (- row 1) column)))))
|
(pascal (- row 1) column)))))
|
||||||
#+END_SRC
|
#+END_SRC
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue