空间复杂度参考表

本文详细讨论了空间复杂度在编程中的重要性,特别关注了不同类型数据结构(如布尔、字符、整数等)在空间限制下的最大范围,以及时间限制对算法设计的影响。
摘要由CSDN通过智能技术生成

空间复杂度参考表

下方都是约等于数值,并非具体数值。

提供一些常规空间限制,其他空间限制请自行计算。

一些差不多的空间限制(如 125 125 125 MiB、 250 250 250 MiB),本表不提供大小。

数组类型 128 128 128 MiB 256 256 256 MiB 512 512 512 MiB
bool ⁡ \operatorname {bool} bool 1 0 9 10^9 109 2 × 1 0 9 2 \times 10^9 2×109 4 × 1 0 9 4 \times 10^9 4×109
char ⁡ \operatorname {char} char 1 0 9 10^9 109 2 × 1 0 9 2 \times 10^9 2×109 4 × 1 0 9 4 \times 10^9 4×109
short ⁡ \operatorname {short} short 6 × 1 0 8 6 \times 10^8 6×108 12 × 1 0 8 12 \times 10^8 12×108 24 × 1 0 8 24 \times 10^8 24×108
int ⁡ \operatorname {int} int 3 × 1 0 8 3 \times 10^8 3×108 6 × 1 0 8 6 \times 10^8 6×108 12 × 1 0 8 12 \times 10^8 12×108
double ⁡ \operatorname {double} double 1 0 8 10^8 108 2 × 1 0 8 2 \times 10^8 2×108 4 × 1 0 8 4 \times 10^8 4×108
long ⁡ \operatorname {long} long long ⁡ \operatorname {long} long 1 0 8 10^8 108 2 × 1 0 8 2 \times 10^8 2×108 4 × 1 0 8 4 \times 10^8 4×108
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值