单选题
266、In computer science an array is a data structure consisting of a group of elements that are accessed by indexing.In most programming languages each element has the same data type and the array occupies a contiguous area of storage.Most programming languages have a built-in array data type , although what is called an array in the language documentation is sometimes really an associative array.Conversely, the contiguous storage kind of array discussed here may alternatively be called a vector, list , or table.Some programming languages support array programming ( ) which generalizes operations and functions to work transparently over arrays as they do with scalars, instead of requiring looping over array members.Multi-dimensional arrays are accessed using more than one index:one for each dimension.Arrays can be classified as fixed-sized arrays ( ) whose size cannot change once their storage has been allocated or dynamic arrays, which can be resized.Fixed-size arrays permit efficient random access.They are compact data structures, having a constant memory overhead.And, on CPUs which support caches sequential iteration over an array has good locality of reference because its elements occupy contiguous memory locations.However, when an array is randomly accessed , for example when probing a hash table, locality of reference may be lost.(2)、Which of the following statements about array is correct?
A
The fixed-size array allows all random access
B
The array occupies a discontinuous storage area
C
Array is a data structure consisting of a group of elements that are accessed by indexing
D
All programming languages have a built-in array data type
答案解析
正确答案:C
