exercise 2.33
(define (map2 p sequence)
(accumulate (lambda (x y)
(cons (p x)
y))
nil sequence))
(define (append2 seq1 seq2)
(accumulate cos seq1 seq2))
(define (length2 sequence)
(accumulate (lambda (x y) (+ 1 y)) 0 sequence))
exercise 2.34
(define (horner-eval x coefficient-sequence)
(accumulate (lambda (this-coeff higher-terms)
(* (+ (* higher-terms x) this-coeff) x))
0
coefficient-sequence))
exercise 2.35
(define (count-leaves t)
(accumulate +
0
(map (lambda (sub-t)
(if (pair? sub-t)
(count-leaves sub-t)
1))
t)))
exercise 2.36
(define (accumulate-n op init seqs)
(if (null? (car seqs))
nil
(cons (accumulate op init (map car seqs))
(accumulate-n op init (map cdr seqs)))))
(define s (list (list 1 2 3) (list 4 5 6) (list 7 8 9) (list 10 11 12)))
分享到:
相关推荐
量子计算和量子信息解决方案 这是Nielsen和Chuang撰写的“ ”(ISBN-13:978-1107002173)的非官方解决方案手册 不能保证这些解决方案是正确的。 如果您有任何意见,请随时打开问题或PR。... 2.36
10 - 7.64 = 2.36 16.39 - 6.47 = 9.92 13.21 - 9.38 = 3.83 13.6 + 8.46 = 22.06 0.99 + 1.1 = 2.09 10.1 - 0.26 = 9.84 3.64 + 9.07 = 12.71 22.13 - 9 = 13.13 7.26 - 4.93 = 2.33 2.16 - 0.23 = 1.93 9.28 + ...
通过这些例子和练习,学习者可以掌握如何在实际项目中有效地使用T-SQL进行连接查询,从而更好地管理和开发数据库。了解并熟练运用这些概念对于数据库管理员和开发人员来说至关重要,因为它们能够帮助提取所需的信息...
- **串行加法器** (2.33): 分析了串行加法器的特点及其适用场景。 - **二进制乘法** (2.34): 讨论了二进制乘法的实现方法。 - **并行乘法器电路** (2.35): 展示了并行乘法器的设计方案。 - **串行乘法器电路** (2.36...
第2章 Java经典练习题 2.1 斐波那契数列 2.2 判断素数 2.3 水仙花数 2.4 分解质因数 2.5 杨辉三角 2.6 学习成绩查询 2.7 求最大公约数与最小公倍数 2.8 完全平方数 2.9 统计字母、空格、数字和其它字符个数 2.10 求...