Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Remember that big-O notation does not include constant factors. The functions f(n) = n and g(n) = 10<sup>100</sup>n are both O(n), though f(n) is a much, much smaller function than g(n).</p> <p>Your analysis is correct - if you can make the space usage (log n) / 2 - 1, then you will (in the limit) be halving the amount of memory required. However, this will not show up in a big-O analysis, since big-O ignores the constant factors. As mentioned in some of the other answers, big-O notation captures long-term growth rates, and although constants might tell you more about the <em>absolute</em> amount of space used, constants don't control the long-term growth rate of the space usage.</p> <p>If you want to do a more precise analysis, you could give the exact memory usages before and after and then say that you have reduced the memory usage by 50%. Many papers on algorithms and data structures do actually include the constant factors and mention that they're getting a constant speedup. For example, the <a href="http://en.wikipedia.org/wiki/Cholesky_decomposition" rel="nofollow">Cholesky factorization</a> algorithm and Gaussian elimination both give O(n<sup>3</sup>) algorithms for solving linear systems, but when the Cholesky factorization can be used it does so with about 50% fewer operations. Most textbooks covering these topics will mention that although both algorithms are O(n<sup>3</sup>), the former is preferable to the latter when it's possible to use it.</p> <p>Hope this helps!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload