1. Sequential storage
Sequential storage structure refers to using a segment of storage units with consecutive addresses to store data in sequence. As shown, each blue square corresponds to a piece of data in the array. Data has types, such as: 32-bit integer int, single-precision floating-point type float, double-precision floating-point type double, character type char, 64-bit integer type long long, 16-bit short integer type short, and so on.
2. Storage method
In the programming language, a one-dimensional array is used to realize the sequential storage structure. In the C language, the first data element is stored in the position with the subscript 0, and the second data element is stored in the subscript 1, and so on.
3. Length and capacity
The length of the array refers to how many elements the array currently has, and the capacity of the array refers to the maximum number of elements the array can store. If the array element is larger than the maximum storage range, it is not allowed in the program, and unexpected problems may occur, and the implementation needs to be avoided.
4, the index
of the array element index in the array, we can use the [] operator to complete
int a[7] = {5, 2, 0, 1, 3, 1, 4}; int b = a[0]
5 , Array of function parameters
When learning functions, we know that if we want to pass two integer variables to the function, return the sum of the two integer variables through the function
_33. Search for a rotated sorted array
_81. Searching rotated sorted array II
_153. Finding minimum value in rotated sorted
array_70. Climbing stairs_
509. Fibonacci
number_1137. Nth Tabonacci number