空间复杂度参考表
下方都是约等于数值,并非具体数值。
提供一些常规空间限制,其他空间限制请自行计算。
一些差不多的空间限制(如 125125125 MiB、250250250 MiB),本表不提供大小。
| 数组类型 | 128128128 MiB | 256256256 MiB | 512512512 MiB |
|---|---|---|---|
| bool\operatorname {bool}bool | 10910^9109 | 2×1092 \times 10^92×109 | 4×1094 \times 10^94×109 |
| char\operatorname {char}char | 10910^9109 | 2×1092 \times 10^92×109 | 4×1094 \times 10^94×109 |
| short\operatorname {short}short | 6×1086 \times 10^86×108 | 12×10812 \times 10^812×108 | 24×10824 \times 10^824×108 |
| int\operatorname {int}int | 3×1083 \times 10^83×108 | 6×1086 \times 10^86×108 | 12×10812 \times 10^812×108 |
| double\operatorname {double}double | 10810^8108 | 2×1082 \times 10^82×108 | 4×1084 \times 10^84×108 |
| long\operatorname {long}long long\operatorname {long}long | 10810^8108 | 2×1082 \times 10^82×108 | 4×1084 \times 10^84×108 |
本文提供了一份空间复杂度的参考表,涵盖了不同数据类型(如bool、char、short等)在内存中占用的最大空间大小,帮助读者理解各种变量类型在算法设计中的使用限制。
4010





