我可以在1GB内存中创建多少个整数? [英] How many integers can I create in 1GB memory?

查看:263
本文介绍了我可以在1GB内存中创建多少个整数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在第200页的Robert Sedgewick的书算法第四版中,它表示例如,如果您的计算机上有1GB的内存(10亿字节),则不能超过约3200万个int值。

In book Algorithms fourth edition by Robert Sedgewick on page 200, it says "for example, if you have 1GB of memory on your computer (1 billion bytes), you cannot fit more than about 32 million int values."

我的计算结果感到困惑:
1,000,000,000字节/ 4字节= 2.5亿

I got confused after my calculation: 1,000,000,000 bytes/4 bytes = 250 million

作者如何得到3200万?

How the author got 32 million?

该书描述如下:

推荐答案

作者承认这是本书网站的错误,请参阅 http://algs4.cs.princeton.edu/errata/errata-printing3.php

The author has acknowledged that this is an error in this book website, please refer to http://algs4.cs.princeton.edu/errata/errata-printing3.php

这篇关于我可以在1GB内存中创建多少个整数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆