当前位置:网站首页>Logical structure and physical structure
Logical structure and physical structure
2022-06-29 20:21: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 .
边栏推荐
- freemarker模板框架生成图片
- PowerShell command outputs only a list of directories
- Win7 Easy Connect prompt: route selection connection failed. The current connection network may be abnormal. Please try again later
- Flume配置1——基础案例
- NLP - giza++ implements word alignment
- Jupyter服务安装及启动
- 命令执行(RCE)漏洞
- 【摸鱼神器】UI库秒变低代码工具——表单篇(一)设计
- 2021 CCPC Harbin E. power and modulo (thinking questions)
- A Japanese Cherry sold at a sky high price of 1980 yuan. Netizen: I feel cheated after eating it
猜你喜欢
随机推荐
SSH命令及使用说明
Spark存储体系底层架构剖析-Spark商业环境实战
Defense cornerstone in attack and defense drill -- all-round monitoring
.NetCore统一认证授权学习——第一次授权(2)
Win7 Easy Connect prompt: route selection connection failed. The current connection network may be abnormal. Please try again later
[notes] take notes again -- learn by doing Verilog HDL – 008
Analysis of the underlying architecture of spark storage system - spark business environment practice
Website stress testing tool - webbench
How to use filters in jfinal to monitor Druid for SQL execution?
60天远程办公经验分享 | 社区征文
Measures to support the development of advanced manufacturing industry in Futian District of Shenzhen in 2022
Nutch2.1分布式抓取
如何审核 Active Directory 用户账户更改?
注解
mapbox-gl开发教程(十二):加载面图层数据
Go deep into the underlying principles of go and rewrite redis middleware without secret
Following the crowd hurts you
. NETCORE unified authentication authorization learning - run (1)
Flume ng configuration
关于印发宝安区重点产业项目和总部项目遴选及用地保障实施细则(2022修订版)的通知







![[compilation principle] type check](/img/fc/458871e2df4e0384f65e09faa909d7.png)

