Logarithmic Scale in Programming I often hear a fellow programmer suggesting “Let’s allocate 2K of memory”. Why 2K? Well, this size sounds about right for this particular data structure. Fine, if this structure is static, but what about dynamic ones, like any collection type? Allocating 2K every time when we need to grow the structure may be fine by today’s standard, but this magic number 2K would look ridiculous a decade later. Logarithmic scale, however, provides an immortal solution. “Last time I allocated X bytes of memory, let’s allocate twice of that this time”. In short, there is no room for linear solutions in the world abiding by Moore’s law. - Study24x7
Social learning Network
27 Apr 2019 11:49 AM study24x7 study24x7

Logarithmic Scale in Programming I often hear a fellow programmer suggesting “Let’s allocate 2K of memory”. Why 2K? Well, this size sounds about right for this particular data structure. Fine, if this structure is static, but what about dynamic ones, like any collection typ...

See more

study24x7
Write a comment
Related Questions
500+   more Questions to answer
Most Related Articles