"Data Structure" (Yan Wei-Min Wu Weimin) study notes - Chapter V and broad array of table

Arrays and tables can be viewed as a generalized linear extension table, the data element table is itself a data structure.

1, array definition

All elements of the array must be of the same data type. Each data element in the array corresponds to a set index (j1, j2,, jn), each individual index ranges from 0 ji bi - 1, bi is called the length dimension i (i = 1, 2,, n). Obviously, when n = 1, n-dimensional array degenerate fixed-length linear form. Conversely, n-dimensional array can be seen as a linear form of promotion.

We can be seen as a two-dimensional array of fixed-length linear form: each of its data element is a fixed-length linear form.

Once an array is defined, its dimension and the dimension is no longer bound to change.

2, showing the order of the array and implemented

Since the array is generally not as insert or delete operation, array Once established, the relationship between the number of elements in the data structure and the element will no longer change. Thus, the array represents a sequential storage structure is natural.

Since the memory cell is a one-dimensional structure, is multidimensional array structure, with a set of contiguous memory locations storing a data element of the array have agreed order problem. Two-dimensional array can be stored in two ways: one column to the main storage sequence order (column major order), and one is the main storage line-sequential order (row major order) of.

 

 

End

Guess you like

Origin www.cnblogs.com/Tom-1103/p/12203865.html