第22页 基础知识
丽拉先生 (必要时撒谎)
在读 算法导论(原书第3版)
- 章节名:基础知识
- 页码:第22页
我们把 表示一个数组或对象的变量 看做 指向数组或对象的数据 的一个指针。对于某个对象x的所有属性f,赋值 y=x 导致 y.f 等于 x.f。进一步,若现在置 x.f=3,则赋值后不但 x.f 等于3,而且 y.f 也等于3。换句话说,在赋值 y=x 后,x 和 y 指向相同的对象。
We treat a variable representing an array or object as a pointer to the data representing the array or object. For all attributes f of an object x, setting y = x causes y.f to equal x.f . Moreover, if we now set x:f = 3, then afterward not only does x.f equal 3, but y.f equals 3 as well. In other words, x and y point to the same object after the assignment y = x.
17人阅读
说明 · · · · · ·
表示其中内容是对原文的摘抄