Algorithms 4
文章平均质量分 53
行者yy
这个作者很懒,什么都没留下…
展开
-
方形件组批优化
方形件组批优化问题第十九届中国研究生数学建模竞赛背景介绍智能制造被“中国制造2025”列为主攻方向, 而个性化定制、更短的产品及系统生命周期、互联互通的服务模式等成为目前企业在智能制造转型中的主要竞争点。以离散行业中的产品为例,如电子器件、汽车、航空航天零部件等,这些产品均是依赖于机械设计、可分散加工、可灵活组装且同类产品款式极多。对于此类产品,客户可能提出的产品需求难以穷举、订单规模难以预测且产品质量要求极高。此时“个性化定制”的服务需求则要求企业具有高效快速的需求分析及产品设计能力、具有原创 2022-10-16 17:24:42 · 1091 阅读 · 1 评论 -
约瑟夫环数学推导及其算法实现
1 问题来源据说著名犹太历史学家Josephus有过以下的故事:在罗马人占领乔塔帕特后,39 个犹太人与Josephus及他的朋友躲到一个洞中,39个犹太人决定宁愿死也不要被敌人抓到,于是决定了一个自杀方式,41个人排成一个圆圈,由第1个人开始报数,每报数到第3人该人就必须自杀,然后再由下一个重新报数,直到所有人都自杀身亡为止。然而Josephus 和他的朋友并不想遵从。首先从一个人开始,越过k-2个人(因为第一个人已经被越过),并杀掉第k个人。接着,再越过k-1个人,并杀掉第k个人。这个过程沿着圆圈原创 2021-09-09 16:29:54 · 596 阅读 · 0 评论 -
1.2CREATIVE PROBLEMS
1.2.15 File input. Develop a possible implementation of the static readInts() method from In (which we use for various test clients, such as binary search on page 47) that is based on the split() method in String.import edu.princeton.cs.algs4.In;public原创 2021-08-09 17:48:20 · 105 阅读 · 0 评论 -
1.2.11_14
1.2.11 Develop an implementation SmartDate of our Date API that raises an exception if the date is not legal.1.2.12 Add a method dayOfTheWeek() to SmartDate that returns a String value Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, or Sunday, g原创 2021-08-08 17:03:06 · 87 阅读 · 0 评论 -
1.2.10
1.2.10 Develop a class VisualCounter that allows both increment and decrement operations. Take two arguments N and max in the constructor, where N specifies the maximum number of operations and max specifies the maximum absolute value for the counter. A原创 2021-08-08 11:29:28 · 77 阅读 · 0 评论 -
1.2.3
1.2.3 Write an Interval2D client that takes command-line arguments N, min, and max and generates N random 2D intervals whose width and height are uniformly distributed between min and max in the unit square. Draw them on StdDraw and print the number of p原创 2021-08-07 21:05:26 · 79 阅读 · 0 评论 -
1.2.2
1.2.2 Write an Interval1D client that takes an int value N as command-line argument, reads N intervals (each defined by a pair of double values) from standard input, and prints all pairs that intersectimport java.util.Scanner;import edu.princeton.cs.a原创 2021-08-06 22:03:05 · 68 阅读 · 0 评论 -
Exercise1.2.1
1.2.1 Write a Point2D client that takes an integer value N from the command line, generates N random points in the unit square, and computes the distance separating the closest pair of points.图片来源:《Algorithms 4 Edition》import edu.princeton.cs.algs4.原创 2021-08-06 20:42:33 · 122 阅读 · 0 评论