408-数据结构
一、绪论
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#5b9bd5",
"primaryTextColor": "#ffffff",
"primaryBorderColor": "#41719c",
"lineColor": "#41719c",
"secondaryColor": "#ffffff",
"tertiaryColor": "#e2f0d9",
"fontSize": "14px",
"fontFamily": "\"Microsoft YaHei\", \"PingFang SC\", \"Segoe UI\", sans-serif"
},
"flowchart": {
"nodeSpacing": 10,
"rankSpacing": 26,
"curve": "basis",
"htmlLabels": true,
"subGraphTitleMargin": { "top": 0, "bottom": 14 }
}
}}%%
graph LR
Root["数据结构"]
Root --> Basic["基本概念"]
Root --> Ele["三要素"]
Basic --> B1["数据"]
Basic --> B2["数据元素/数据项"]
Basic --> B3["数据对象/数据结构"]
Basic --> B4["数据类型/<br>抽象数据类型(ADT)"]
Ele --> E1["逻辑结构"]
Ele --> E2["物理结构<br>(存储结构)"]
Ele --> E3["数据的运算"]
E1 --> L1["线性结构"]
E1 --> L2["集合"]
E1 --> L3["树形结构"]
E1 --> L4["图结构<br>(网状结构)"]
E2 --> P1["顺序存储"]
E2 --> P2["链式存储"]
E2 --> P3["索引存储"]
E2 --> P4["散列存储"]
E3 --> O1["按逻辑结构定义,<br>按存储结构实现"]
classDef root fill:#5b9bd5,stroke:#41719c,stroke-width:2px,color:#fff,font-weight:bold;
classDef normal fill:#fff,stroke:#5b9bd5,stroke-width:2px,color:#000;
classDef key fill:#fff,stroke:#c00000,stroke-width:3px,color:#000;
class Root root;
class Basic,Ele normal;
class B1,B2,B3,L1,L2,L3,L4,P1,P2,P3,P4,O1 normal;
class B4,E1,E3 key;
subgraph NL["非线性结构"]
direction LR
L2
L3
L4
end
subgraph N1["定义ADT = 定义逻辑结构 + 运算<br>即定义数据结构"]
Basic
B1
B2
B3
B4
end
subgraph N2["确定存储结构 = 表示逻辑结构<br>存储不同,运算实现不同"]
E2
P1
subgraph NS["非顺序存储"]
direction LR
P2
P3
P4
end
end
style NL fill:#e2f0d9,stroke:#5b9bd5,color:#000000
style NS fill:#e2f0d9,stroke:#5b9bd5,color:#000000
style N1 fill:#f4faf0,stroke:#70ad47,color:#000000,font-size:12px
style N2 fill:#f4faf0,stroke:#70ad47,color:#000000,font-size:12px
%%{init: {
"theme": "base",
"themeVariables": {
"primaryColor": "#5b9bd5",
"primaryTextColor": "#ffffff",
"primaryBorderColor": "#41719c",
"lineColor": "#41719c",
"secondaryColor": "#ffffff",
"tertiaryColor": "#e2f0d9",
"fontSize": "16px",
"fontFamily": "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sans\", sans-serif"
},
"flowchart": {
"nodeSpacing": 10,
"rankSpacing": 26,
"curve": "basis",
"htmlLabels": true,
"subGraphTitleMargin": { "top": 0, "bottom": 14 }
}
}}%%
graph LR
Root["算法的基本概念"]
Root --> What["什么是算法"]
Root --> Five["算法的五个特性"]
Root --> Good["#quot;好#quot;算法的特质"]
What --> Prog["程序=数据结构 + 算法"]
Prog --> P1["数据结构是<br>要处理的信息"]
Prog --> P2["算法是处理<br>信息的步骤"]
Five --> F1["有穷性"]
Five --> F2["确定性"]
Five --> F3["可行性"]
Five --> F4["输入"]
Five --> F5["输出"]
F1 --> F1a["有穷时间内能执行完"]
F1a --> F1b["算法是有穷的"]
F1a --> F1c["程序可以是无穷的"]
F2 --> F2a["相同输入只会<br>产生相同输出"]
F3 --> F3a["可以用已有的基本<br>操作实现算法"]
F4 --> F4a["丢给算法处理的数据"]
F5 --> F5a["算法处理的结果"]
Good --> G1["正确性"]
Good --> G2["可读性"]
Good --> G3["健壮性"]
Good --> G4["高效率与低<br>存储量需求"]
G1 --> G1a["能正确解决问题"]
G2 --> G2a["对算法的描述要让<br>其他人也看得懂"]
G3 --> G3a["算法能处理<br>一些异常状况"]
G4 --> G4a["即算法执行<br>省时、省内存"]
G4a --> G4b["时间复杂度低、<br>空间复杂度低"]
classDef root fill:#5b9bd5,stroke:#41719c,stroke-width:2px,color:#fff,font-weight:bold;
classDef normal fill:#fff,stroke:#5b9bd5,stroke-width:2px,color:#000;
classDef key fill:#fff,stroke:#c00000,stroke-width:3px,color:#000;
class Root root;
class What,Prog,Five,Good normal;
class F1,F2,F3,F4,F5,G1,G2,G3,G4 normal;
class P1,P2,F1a,F1b,F1c,F2a,F3a,F4a,F5a,G1a,G2a,G3a,G4a normal;
class G4b key;
subgraph N1["设计一个好的数据结构<br>设计一个好的算法"]
What
Prog
P1
P2
end
subgraph N2["算法必须具备的特性"]
Five
F1
F2
F3
F4
F5
end
subgraph N3["设计算法时要<br>尽量追求的目标"]
G4
G4a
end
style N1 fill:#f4faf0,stroke:#70ad47,color:#000000,font-size:12px
style N2 fill:#f4faf0,stroke:#70ad47,color:#000000,font-size:12px
style N3 fill:#f4faf0,stroke:#70ad47,color:#000000,font-size:12px
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Milvelas!





