How many integers can I create in 1GB memory?

后端 未结 2 521
醉梦人生
醉梦人生 2021-01-18 11:25

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 t

相关标签:
2条回答
  • 2021-01-18 12:16

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

    0 讨论(0)
  • 2021-01-18 12:24

    1 gigabit = 1073741824 bit
    1 int = 32 bit
    calculation = (1073741824/32) = (32 * 10242) = (32 * 220) = 32 million

    If author meant gigabytes then answer would be (32 * 8) million = 256 million

    0 讨论(0)
提交回复
热议问题