算法导论翻译类似于归纳算法算法导论第二章中的原文是:We state these properties of A[1 ¨ j -1] formally as a loop invariant.其中举的例子是插入排序,每次循环从数组A中取出第j个元素插入有序区A[1 .. j

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/29 02:56:17
算法导论翻译类似于归纳算法算法导论第二章中的原文是:We state these properties of A[1 ¨ j -1] formally as a loop invariant.其中举的例子是插入排序,每次循环从数组A中取出第j个元素插入有序区A[1 .. j

算法导论翻译类似于归纳算法算法导论第二章中的原文是:We state these properties of A[1 ¨ j -1] formally as a loop invariant.其中举的例子是插入排序,每次循环从数组A中取出第j个元素插入有序区A[1 .. j
算法导论翻译
类似于归纳算法
算法导论第二章中的原文是:We state these properties of A[1 ¨ j -1] formally as a loop invariant.其中举的例子是插入排序,每次循环从数组A中取出第j个元素插入有序区A[1 .. j-1],然后递增j.这样A[1 .. j-1]的有序性始终得到保持,这就是所谓的“循环不变”了.
这个概念主要用来检验算法的正确性.
原文如下:We use loop invariants to help us understand why an algorithm is correct. We must show three things about a loop invariant:
Initialization: It is true prior to the first iteration of the loop.
Maintenance: If it is true before an iteration of the loop, it remains true before the next iteration.
Parameters are passed to a procedure by value: the called procedure receives its own copy of the parameters, and if it assigns a value to a parameter, the change is not seen by the calling procedure. When objects are passed, the pointer to the data representing the object is copied, but the object's fields are not. For example, if x is a parameter of a called procedure, the assignment x ← y within the called procedure is not visible to the calling procedure. The assignment f [x] ← 3, however, is visible.
求计算机专业人员的翻译 不太了解这个procedure 是翻译为“函数”吗?
以上提问有误: 仅一下这一段:
Parameters are passed to a procedure by value: the called procedure receives its own copy of the parameters, and if it assigns a value to a parameter, the change is not seen by the calling procedure. When objects are passed, the pointer to the data representing the object is copied, but the object's fields are not. For example, if x is a parameter of a called procedure, the assignment x ← y within the called procedure is not visible to the calling procedure. The assignment f [x] ← 3, however, is visible.
求计算机专业人员的翻译 不太了解这个procedure 是翻译为“函数”吗?

算法导论翻译类似于归纳算法算法导论第二章中的原文是:We state these properties of A[1 ¨ j -1] formally as a loop invariant.其中举的例子是插入排序,每次循环从数组A中取出第j个元素插入有序区A[1 .. j
个人理解这个procedure 应该是指代码的执行过程,每一行代码其实都可以看做是一个procedure
以Java为例,如果有如下代码:
int x = 5;
int y = 3;
int z;
z= x + y;
按照文意,参数(我觉得这里就差不多是变量的意思)是以其数值在代码执行中进行传递的: 调用某一变量的代码执行过程 z = x + y 获得的只是 x 和 y 的副本, 如果一段代码执行给某一变量赋值, 这一变化是不能被调用x 和y 的z = x + y看到的, 当一个对象被传值的时候, 这个对象在内存中是不变的,只不过是复制了一个指向这个对象的指针而已.
当z= x + y执行时, z= x + y是不管x和y怎样的,它只知道需要指针分别指向X和Y 在内存中的位置, 而如果是x = 3 的话, 因为3是具体数值而不是另一个变量,因此这里对x的赋值就是“可见”了
以上是我的一点拙见,只是我个人的理解,请楼主谨做参考

算法导论翻译类似于归纳算法算法导论第二章中的原文是:We state these properties of A[1 ¨ j -1] formally as a loop invariant.其中举的例子是插入排序,每次循环从数组A中取出第j个元素插入有序区A[1 .. j 关于算法导论 算法导论讲什么 算法导论什么时候有翻译的第三版? 算法导论多少页?你数数. 《算法导论》最快多少天能掌握? 算法导论需要什么基础没学过离散数学跟概率统计 看算法导论是不是困难很大呀 为什么在《算法导论》中,lg变成了以2为底?在算法导论第二版第33页说lg以2为底,lg不是以10为底么? 关于算法导论红黑树旋转的问题.左旋转第三行 p[left[y]] = 计算机导论题目设计算法 计算n阶乘 并分析时间复杂性. 算法导论第三版什么时候出(中文版)今年的几月份? 算法 算法 算法导论 第二版 第三版的区别?手上有一本中文版的CLRS 2ed,据说3ed就多了个并行算法,2和3在翻译上哪个更好一些(因为我看到译者有一个叫邹恒明教授,他出的那基本比较有意思的普及书我看 关于算法导论的问题我学过C语言和数据结构,但没有学过离散数学,可以看懂这本书吗?或者可以看懂网易的算法导论公开课 数论证明题:证明对任意整数a,b,n,如果n|ab且gcd(a,n)=1,则n|b这是出现在《算法导论》第31章数论算法的题. 算法导论上31章数论算法的证明题31.7-2 证明:如果Alice的公开指数e等于3,并且对方获得Alice的秘密指数d,0 上取整函数的问题n为任意实数 a,b为整数ceiling(ceiling(n/a)/b) =ceiling(n/ab)在算法导论上看到的