![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
pat-mooc
文章平均质量分 75
lulu901130
这个作者很懒,什么都没留下…
展开
-
03-树1. 二分法求多项式单根
二分法求函数根的原理为:如果连续函数f(x)在区间[a, b]的两个端点取值异号,即f(a)f(b)二分法的步骤为:检查区间长度,如果小于给定阈值,则停止,输出区间中点(a+b)/2;否则如果f(a)f(b)如果f((a+b)/2)正好为0,则(a+b)/2就是要求的根;否则如果f((a+b)/2)与f(a)同号,则说明根在区间[(a+b)/2, b],令a=(原创 2015-03-25 23:08:16 · 429 阅读 · 0 评论 -
03-树2. List Leaves
Given a tree, you are supposed to list all the leaves in the order of top down, and left to right.Input Specification:Each input file contains one test case. For each case, the first line give原创 2015-03-28 14:27:21 · 372 阅读 · 0 评论 -
04-树4. Root of AVL Tree
An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by more than one, rebalancing is原创 2015-03-29 00:18:00 · 391 阅读 · 0 评论 -
04-树5. File Transfer
We have a network of computers and a list of bi-directional connections. Each of these connections allows a file transfer from one computer to another. Is it possible to send a file from any computer原创 2015-03-29 21:11:27 · 443 阅读 · 0 评论 -
06-图8. 关键活动
本实验项目是实验项目6-06的深化。任务调度问题中,如果还给出了完成每个子任务需要的时间,则我们可以算出完成整个工程需要的最短时间。在这些子任务中,有些任务即使推迟几天完成,也不会影响全局的工期;但是有些任务必须准时完成,否则整个项目的工期就要因此延误,这种任务就叫“关键活动”。请编写程序判定一个给定的工程项目的任务调度是否可行;如果该调度方案可行,则计算完成整个工程项目需要的最短时间,并原创 2015-06-10 20:55:21 · 835 阅读 · 0 评论 -
03-树3. Tree Traversals Again
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys numbered from 1 to 6) is traversed, the stac原创 2015-03-28 15:23:16 · 671 阅读 · 0 评论