【SICP练习】89 练习2.62
2015-09-08 00:00
253 查看
练习2.62
前面已经遇到过了,union-set是用来取并集的。我们要通过多种情况来完成这个程序。(define (union-set set1 set2) (cond ((and (null? set1) (null? set2)) '()) ((null? set1) set2) ((null? set2) set1) (else (let ((x (car set1)) (y (car set2))) (cond ((= x y) (cons x (union-set (cdr set1) (cdr set2)))) ((< x y) (cons x (union-set (cdr set1) set2))) ((> x y) (cons y (union-set set1 (cdr set2)))))))))
感谢访问,希望对您有所帮助。 欢迎关注或收藏、评论或点赞。
为使本文得到斧正和提问,转载请注明出处:
http://blog.csdn.net/nomasp
版权声明:本文为 NoMasp柯于旺 原创文章,未经许可严禁转载!欢迎访问我的博客:http://blog.csdn.net/nomasp
相关文章推荐
- [Android]在代码里运行另一个程序的方法
- DB2编程序技巧(1)
- DB2编程序技巧 (四)
- DB2编程序技巧 (六)
- DB2编程序技巧 (三)
- DB2编程序技巧 (九)
- DB2编程序技巧 (七)
- DB2编程序小小技巧
- DB2编程序技巧 (五)
- 二级域名原理以及程序
- DB2编程序技巧 (一)
- DB2编程序技巧 (八)
- DB2编程序技巧 (十)
- set 命令特殊用法
- 如何隐藏程序的运行
- C#列出当前系统所有正在运行程序的方法
- 纯真、珊瑚虫文本IP数据库转成mdb 程序 提供下载
- SQL学习笔记六 union联合结果集使用
- You must SET PASSWORD before executing this statement的解决方法
- 数据库性能优化三:程序操作优化提升性能