《算法导论》第一章-第1节_练习(参考答案)
2017-07-10 21:21
309 查看
算法导论(第三版)参考答案:练习1.1-1,练习1.1-2,练习1.1-3,练习1.1-4,练习1.1-5
排队问题:小学体育课上,老师要求我们由低到高站成一列。
防线修建:在经费有限的情况下,尽可能多的包含自己的城市。
资源利用率、内存占用情况。
链表
优势:可变长度、不需要连续内存空间。
局限:查询某元素,需要遍历链表、需要多余的空间存放指针。
相似之处在于都是在寻找最短路径。
区别在于,最短路径问题是在给定两坐标后,寻找之间的实际路径长短最短的路线;而旅行商问题是需要遍历所有的地点后,最终回到起点的最短路线。
如果你女朋友不喜欢香菜,那么在你俩的烛光晚餐中,必须不能有一点香菜。不然你的计划就泡汤了!
如果你的朋友不喜欢香菜,那么在一起出去聚餐时,碰巧点了一个上面撒了香菜的蛋羹。情况会好很多。
Exercise 1.1-1
Give a real-world example that requires sorting or a real-world example that requires computing a convex hull.排队问题:小学体育课上,老师要求我们由低到高站成一列。
防线修建:在经费有限的情况下,尽可能多的包含自己的城市。
Exercise 1.1-2
Other than speed, what other measures of efficiency might one use in a real-world setting?资源利用率、内存占用情况。
Exercise 1.1-3
Select a data structure that you have seen previously, and discuss its strengths and limitations.链表
优势:可变长度、不需要连续内存空间。
局限:查询某元素,需要遍历链表、需要多余的空间存放指针。
Exercise 1.1-4
How are the shortest-path and traveling-salesman problems given above similar? How are they different?相似之处在于都是在寻找最短路径。
区别在于,最短路径问题是在给定两坐标后,寻找之间的实际路径长短最短的路线;而旅行商问题是需要遍历所有的地点后,最终回到起点的最短路线。
Exercise 1.1-5
Come up with a real-world problem in which only the best solution will do. Then come up with one in which a solution that is “approximately” the best is good enough.如果你女朋友不喜欢香菜,那么在你俩的烛光晚餐中,必须不能有一点香菜。不然你的计划就泡汤了!
如果你的朋友不喜欢香菜,那么在一起出去聚餐时,碰巧点了一个上面撒了香菜的蛋羹。情况会好很多。
相关文章推荐
- 《算法导论》第五章-第1节_练习(参考答案)
- 《算法导论》第二章-第1节_练习(参考答案)
- 《算法导论》第四章-第1节_练习(参考答案)
- 《算法导论》第一章-第2节_练习(参考答案)
- 《算法导论》第三章-第1节_练习(参考答案)
- 《算法导论》第五章-第3节_练习(参考答案)
- 《算法导论》第五章-第4节_练习(参考答案)
- 《算法导论》第四章-第6节_练习(参考答案)
- 《算法导论》第一章-思考题(参考答案)
- 《算法导论》第二章-第3节_练习(参考答案)
- 《算法导论》第四章-第2节_练习(参考答案)
- 《算法导论》第三章-第2节_练习(参考答案)
- 《算法导论》第四章-第4节_练习(参考答案)
- 《算法导论》第四章-第5节_练习(参考答案)
- 数据结构、算法与应用C++语言描述(第二版) 第一章部分练习参考答案
- 《算法导论》第二章-第2节_练习(参考答案)
- 《算法导论》第四章-第3节_练习(参考答案)
- CCF计算机软件能力认证试题练习-数位之和(Java参考答案学习记录)
- 《算法导论》第四章-思考题(参考答案)
- 《算法导论》第三章-思考题(参考答案)