当前位置:网站首页>Logical structure and physical structure
Logical structure and physical structure
2022-07-05 06:49:00 【An embedded enthusiast】
Logical structure and physical structure
Logical structure
In a nutshell , Logical structure is the relationship between data . There are four common types of logical structures : Set structure , Linear structure , A tree structure , Graphic structure .
Set structure
On the surface , There is no deep meaning , That is, the data elements belong to the same set , There is no relationship between individual data elements . As shown in the figure below .
Linear structure
A linear structure is similar to a linear relationship , in other words , There is a one-to-one relationship between data elements in a linear structure . Be careful : Focus on one to one . As shown in the figure below .
A tree structure
There is a one to many relationship between data elements in the tree structure .( The graph formed by each element and its relationship is similar to the tree view ). Be careful : The relationship is one to many . As shown in the figure below .
Graphic structure
There is a many to many relationship between data elements . As shown in the figure below .
Physical structure
Also called storage structure , Divided into two , One is sequential storage structure and the other is chain storage structure , It refers to the choice of centralized storage or decentralized storage of data in the physical storage space . Suppose that the storage size to be stored is 10G The data of , It is stored in a centralized way, as shown in the figure 3a) Shown , Scattered storage, as shown in the figure 3b) Shown .
If you choose centralized storage , Just use the sequential storage structure ; conversely , Just use chain storage . As for how to choose , It mainly depends on the state of the storage device and the purpose of the data .
We know , Centralized storage ( Sequential storage )( The underlying implementation uses arrays ) Need to use a large continuous physical space , Suppose that the storage size to be stored is 1G The data of , If there is no block on the storage device with a size greater than 1G Space , You can't use sequential storage , At this point, you need to select chain storage , Because chained storage is random storage of data , It takes up relatively small storage space in the storage device , Therefore, there is a certain probability that you can store success
also , The purpose of data is different , The storage structure chosen is also different . The centralized storage of data is conducive to the traversal of data in the later stage , Decentralized storage is more conducive to adding or deleting data later . therefore , If you need a lot of data retrieval later ( Traverse ), Choose centralized storage ; conversely , If the data needs to be further updated later ( Add or delete ), Then select decentralized storage ( Chain store ).
There is no conflict between logical structure and physical structure , One refers to the relationship between data , The other refers to the expression of this relationship in the computer . such as , Stack in linear table , The relationship between data elements is one-to-one , Every node, except the head and tail nodes, has a unique precursor and a unique successor , It's a logical structure ; And for nodes in the stack , They can be stored sequentially ( That is, the sequence stack ), Take a continuous section of storage space , Store stack nodes in order , Each node is physically adjacent to its predecessor and successor . meanwhile , Stack nodes can also be chained ( Chain stack ), Each node includes data field and pointer field , The pointer field is used to point to its successor , When accessing, you can find the subsequent access through the pointer , Each node can be physically adjacent or not adjacent .
边栏推荐
- 2022 winter vacation training game 5
- Marvell 88E1515 PHY loopback模式测试
- 6-3 find the table length of the linked table
- Volcano resource reservation feature
- Vant Weapp SwipeCell设置多个按钮
- Vscode creates its own code template
- How to answer when you encounter a jet on CSDN?
- 微信小程序路由再次跳转不触发onload
- Some classic recursion problems
- . Net core stepping on the pit practice
猜你喜欢
随机推荐
Vant weave swipecell sets multiple buttons
Orin 两种刷机方式
Using handler in a new thread
Architecture
Vant Weapp SwipeCell設置多個按鈕
Preemption of CFS scheduling
使用paping工具进行tcp端口连通性检测
乐鑫面试流程
微信小程序路由再次跳转不触发onload
Skywalking all
Use ffmpeg to rotate, flip up and down, and flip horizontally
kata container
SolidWorks template and design library are convenient for designers to call
LSA Type Explanation - lsa-5 (type 5 LSA - autonomous system external LSA) and lsa-4 (type 4 LSA - ASBR summary LSA) explanation
Orin installs CUDA environment
SRE核心体系了解
NVM Downloading npm version 6.7.0... Error
VLAN experiment
将webApp或者H5页面打包成App
The differences and connections among cookies, sessions, JWT, and tokens









