第3回 - 奥乃研究室
第3回 - 奥乃研究室
第3回 - 奥乃研究室
- No tags were found...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
0,fib(n) 1, fib(n 1) fib(n 2 ),if n 0if n 1otherwise(define (fib n)(cond ((= n 0) 0)((= n 1) 1)(else (+ (fib (- n 1))(fib (- n 2)) ))))35abi1i1 a b afib(n) biiniwhereab001 0(define (fib-i n)(define (iter a b count)(if (= count 0)b(iter (+ a b) a (- count 1)) ))(iter 1 0 n) )36(define (fib-i n)(define (iter a b count)(if (= count 0) 木 構 造 再 帰b(iter (+ a b) a (- count 1)) ))(iter 1 0 n) )ブロック 構 造 を 使 わないと,(define (fib-i n)(fib-iter 1 0 n) )(define (fib-iter a b count)(if (= count 0)b(fib-iter (+ a b) a (- count 1))))3711