一个激进的方式是,切片多维数据为平行的一维数组。
A somewhat more radical idea is to slice up multidimensional arrays into parallel single one-dimension arrays.
它还提供三种访问数组元素的方法:标准索引、创建子数组和切片(slicing),切片能产生维数更小的数组片段的视图。
It also provides three methods for accessing array elements: standard indexing, creating subarrays, and slicing, which produces a less dimensional view of an array segment.
该切片所引用的数组分段可以通过将新的切片赋值给同一变量来更改。
The segment of the array that the slice references can be changed by assigning a new slice to the same variable.
切片s的容量是数组从s[0]到数组尾端的大小,并由内建的cap函数返回。
The capacity of a slice s is the size of the array from s [0] to the end of the array, and is returned by the cap built-in function.
一个切片(slice)表示一个数组内的连续分段,支持程序员指定底层存储的明确部分。
A slice represents a contiguous segment of an array, allowing a programmer to refer to specific sections of the underlying storage.
通常,一个切片就是一个程序所需要的全部了,在这种情况下,程序员根本用不着一个数组,Go有两种方式直接创建切片而不用引用底层存储。
In that case, a programmer need not have an array at all. Go offers two ways to make slices directly without ever referencing the underlying storage.
通常,一个切片就是一个程序所需要的全部了,在这种情况下,程序员根本用不着一个数组,Go有两种方式直接创建切片而不用引用底层存储。
In that case, a programmer need not have an array at all. Go offers two ways to make slices directly without ever referencing the underlying storage.
应用推荐