What is the linear form? (Dwell)

What is the linear form?

Linear table, you can feel from the name, it is a table with a line like the same nature. In the square, there are a lot of people scattered around, some of them children, may also have a lot of adults, even many pets, children of these data for the entire plaza population, can not be regarded as a linear structure of the table. But like the children of the class, lined up one after another, there is a beginning, has an ending, among children who know each one is in front of him, behind him so as one who has a line up their series. It can be called a linear table.

  • Linear table, the full name of the linear structure is stored. Manner using a linear table storage data, it can be appreciated that "all the data strings with a line children up, and then stored in the physical space."
  • Table of money (List): zero or more data elements of a limited series.

1, the logical structure of the linear form

  • Definition: linear finite sequence table having the same data type n (n≥0) data elements. Where n is the length of the table. When n = 0, a linear table is empty table
  • Features: linear form element called a first header element; last element called footer element. In addition to the first element, each element has only one immediate predecessor. In addition to the last element, each element has one and only one immediate successor.

a) it is most people think of storage, whereas panel b) but few people think. We know that the success of the stored data or not, depending on whether data integrity can be restored to its original look. If a panel a) and b) of the hoist line, you will find the location of the data still has not changed (Figure 1 and the same). Therefore concluded that these two storage methods are correct.

The data has a "one to one" relationship "linear" is stored in the physical space, this storage structure is called a linear memory structure (referred to as the linear form).

2, the structure and the sequential storage Storage Structure

As can be seen in FIG., A linear table storing data can be divided into the following two kinds:

  1. FIG. A), the data is sequentially stored in a contiguous block of physical space, this storage structure is referred to sequential storage structure (the sequence table ) ;
  2. ) Shown in FIG. B, the dispersion of data stored in the physical space, by a wire holds the logical relationships between them, this storage structure is referred Storage Structure (abbreviated list );

That is, a linear table storage structure may be subdivided into sequential storage structure and chain storage structure.

3, precursor and successor

Data structure, a set of data for each individual is referred to as " data elements " (referred to as " element "). For example, this set of data shown in FIG, 3, 4 and 5 which is an element of the set of data.
Further, for the data having the logic "one", we have been using "an element in the left (front) or right (rear)," words such unprofessional, in fact, a linear table has more precise term :

  • Left neighbors of an element referred to as " immediate predecessor all elements" on the left side of this element are collectively referred to as " precursor element ";
  • Right neighbors of an element called " direct successor ", this element is located on the right side of all the elements are collectively referred to as " subsequent element ";

Published 91 original articles · won praise 16 · views 1166

Guess you like

Origin blog.csdn.net/hewenqing1/article/details/103971305
Recommended