1
0
mirror of https://github.com/Didnelpsun/CS408.git synced 2026-02-08 13:24:29 +08:00
Files
CS408/Data-Structrue/array.md
Didnelpsun 9528d486d6 串更新
2021-04-22 23:31:40 +08:00

25 lines
692 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 数组
## 数组的存储结构
### 一维数组
各数组元素大小相同,且物理上连续存放。
数组元素a[i]的存放地址=起始地址LOC+i*sizeof(ElemType)。数组下标从0开始。
### 二维数组
二维数组存储方式还是同一维数组一样连续的。
+ 行优先:一行一行存储。
+ 列优先:一列一列存储。
已知二维数组b[M][N]。
若按行存储b[i][j]的存储地址=起始地址LOC+(i\*N+j)*sizeof(ElemType)。
### 十字链表法
每个结点中包含行数、列数、元素值以及两个指针向下域指针down指向同第j列的下一个个元素向右域指针right指向同第i行的下一个元素。