Physical structure

Physical structure:
refers to the storage form of the logical structure of data in the computer.
Data is a collection of data elements, so according to the definition of physical structure, it is actually how to store the data elements in the memory of the computer. The memory is mainly for memory. The data organization of external memories such as hard disks, floppy disks, and optical disks is usually Use the file structure to describe.
The storage structure of data should correctly reflect the logical relationship between data elements, which is the most critical. How to store the logical relationship between data elements is the focus and difficulty of realizing the physical structure.
There are two storage structure forms for data elements: sequential storage and chain storage.
1. Sequential storage structure
The data elements are stored in consecutive address storage units, and the logical and physical relationships between the data are consistent. Insert picture description here
This storage structure is very simple, is it a familiar feeling? When learning computer languages, arrays, unlike the current storage method, data is such a sequential storage structure. Tell the computer when defining an integer array, I want to define an array with 9 integer members, the computer finds a deserted empty space in memory, according to the size of the position occupied by an integer, and then clicks and clicks continuously A continuous space, throw it to you, it ’s up to you, let ’s play, so you put your 9 members in order, the first is placed in the first position of the array, the second is placed in the second Location, once placed.
2. Chain storage structure
If you say that this world is full of love for everyone, it is a beautiful world. Unfortunately, society, there are places where there are people, there are always some people, do not follow the rules For example, buy a train ticket, some people like to jump in line, and some people are anxious to change the plane and go to (haha), so, there are always new arrivals, old departures, the entire team, all the time Not in the process of change, obviously, sequential storage is unscientific to deal with such situations.
Here we introduce the chain storage structure:
Chained storage structure: data elements are stored in any storage unit. This group of storage units can be continuous or discontinuous. Storing relationship data elements which can reflect the logic, it is necessary to store a pointer address with the data element, so that the address can be found associated with the location data element Insert picture description here
ah, such a look, feel much more flexible chain stores, data exists It doesn't matter where, as long as there is a pointer to store the corresponding address.
Well, to sum up briefly, the logical structure is problem-oriented, while the physical structure is computer-oriented, and its basic goal is to store data and its logical relationships in the computer's memory.

Published 53 original articles · praised 16 · visits 2213

Guess you like

Origin blog.csdn.net/m0_37757533/article/details/100188913