Skip to content

Commit

Permalink
update chap 16.2
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuxiuwei committed Sep 8, 2016
1 parent 79efe09 commit 299ff4e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion Chapter16_GreddyAlgorithms.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,8 @@ f: 4 5 9
走到2L水能到达的最远的补水点补水。[代码](https://github.com/zhuxiuwei/CLRS/blob/master/src/chap16_GreedyAlgorithms/ProfessorWaterSupplement.java)
__注意点__:处理到最后一个点后,要有特殊处理。

16.2-5
16.2-5(此题目的中文翻译不清楚。括号里为注释。) 设计一个高效算法,对实数线上给定的点集合{x1, x2, ...,xn}(实数,即浮点型,不是整数),求一个__数量最少__的单位长度闭区间(即长度=1的区间)集合,使得这些集合能覆盖所有给定的点。证明你的算法正确。
思路:假设点集合{x1, x2, ...,xn}是有序递增(若不是有序的,先排序)的。每次选择最左边的没有被覆盖的点,设xi,取区间{xi, xi + 1}, 如此往复,直到所有点覆盖完为止。



2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Introduction to ALGORITHMS(CLRS) 3rd editions solutions(Implemented in Java).
算法导论第三版中的算法及习题。所有算法用Java语言实现
算法导论第三版中的算法及习题。实现语言为Java
=

0 comments on commit 299ff4e

Please sign in to comment.