早教吧作业答案频道 -->其他-->
算法导论算法导论英文版第二章2.1节关于伪代码的第八条我看的不是很懂敢问那位大侠翻译并解释一下以下是原文“Parametersarepassedtoaprocedurebyvalue:thecalledprocedurereceivesitsowncopy
题目详情
算法导论
算法导论 英文版 第二章 2.1节关于伪代码的第八条 我看的不是很懂 敢问那位大侠翻译并解释一下 以下是原文
“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.”
算法导论 英文版 第二章 2.1节关于伪代码的第八条 我看的不是很懂 敢问那位大侠翻译并解释一下 以下是原文
“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.”
▼优质解答
答案和解析
在一个过程中,参数通过值来传递:调用过程收到它自己其中的参数,如果参数被赋上一个值,这个变化对调用过程是不可见的.当对象被传递的时候,数据的指针代表了对象被复制,但是对象域却没有.例如,如果x是一个调用过程的参数,在调用过程内部把x赋值为y对于调用过程来说是不可见的.但是如果把f[x]这个数组赋值为3,就是能可见的.
水平有限..希望能有所帮助~
水平有限..希望能有所帮助~
看了算法导论算法导论英文版第二章2...的网友还看了以下:
W=FScosβ公式中,cosβ是否本身就有的么?公式中的S是指位移还是路程?为甚么有些地方是路程? 2020-03-30 …
像素越高,是否位宽容度也越高,还有的是位宽度(例如24位宽容度)等于宽容度吗? 2020-05-13 …
直线运动中质点位移的大小一定等于其路程吗曲线运动用v=s/t求出的是不是平均速度为什么这里的s指的 2020-05-14 …
下列说法中正确的是()A.打点计时器是一种测量长度的仪器B.出租汽车按位移的大小收费C.“万米”赛 2020-05-14 …
V=v0+at↓2与x=v0t+1/2at↓2?x不等于V0t+at↓2是不是因为V乘t等于路程而 2020-05-17 …
赵丽j讲的词汇5500第一课第5节里lie的两种过去式变化,她说规则变化的是位于、说谎,可我查了几 2020-06-12 …
阅读短文A一列火车缓缓地驶出柏林,车厢里尽是妇女和孩子,几乎看不到一个健壮的男子.在一节车厢里,坐 2020-06-18 …
物理许多问题物体的位移随时间变化的函数关系是x=4t+2(t的平方),x代表的是位移则它运动的初速 2020-06-29 …
四大文明古国中位于西亚的:、、、四大文明古国中位于西亚的是,位于东亚的是,位于南亚的是流经西亚的那 2020-06-30 …
近球小管和近曲小管是一样的吗关于致密斑的描述,下列正确的是(A)A.位于近球小管起始部B.是Na+ 2020-07-01 …