SICP 习题2.33 用accumulate完成一些基本的表操作
来源:互联网 发布:暴力解压rar软件 编辑:程序博客网 时间:2024/06/05 12:40
这个accumulate比第一章完成更强大
(define (accumulate op initial sequence) (if (null? sequence) initial (op (car sequence) (accumulate op initial (cdr sequence)))))(define (map p sequence) (accumulate (lambda (x y) (cons (p x) y)) () sequence))(define square (lambda (x) (* x x)))(newline)(display (map square (list 1 2 3 4 5)))(define (append seq1 seq2) (accumulate cons seq2 seq1))(newline)(display (append (list 1 2 3) (list 4 5 6)))(define (length sequence) (accumulate (lambda (x y) (+ 1 y)) 0 sequence))(newline)(display (length (list 1 2 (list 3 4))))
0 0
- SICP 习题2.33 用accumulate完成一些基本的表操作
- SICP 习题2.36 accumulate-n的实现
- SICP 习题2.35 count-leaves 用accumulate实现
- SICP 习题2.37 矩阵乘法的一些实现
- sicp 习题2.33
- SICP 习题 (2.25)解题总结:列表的操作
- SICP习题1.6的解答
- SICP 习题2.59 union-set操作
- SICP习题
- SICP 习题2.2 线段的中点
- SICP的一些个人看法
- 链表的一些基本操作
- 顺序表的一些基本操作
- 表空间的一些基本操作
- 链表的一些基本操作
- Oracle表的一些基本操作
- 链表的一些基本操作
- 对表的一些基本操作
- android studio 解决debug adb端口问题,亲身经历总结
- 凸多边形的三角剖分
- 第15周项目一—代码填空
- 商城一般的组织模板
- 初学HTML心得
- SICP 习题2.33 用accumulate完成一些基本的表操作
- 大数据平台用于生成数据跑批脚本的脚本(version3.0)
- S3c2440中断学习
- 使用过滤器统一全站编码
- concat join reverse slice sort push unshift pop splice Array对象常用方法
- Mysql中的TIMESTAMPDIFF和TIMESTAMPADD
- session
- Android帧动画(Drawable Animation)的使用总结
- C语言基础 类型强制转换