java - Resizing an array: How much should it be done? -


i implementing stack using array. , needs grow @ point push items on stack. wondering how should resized? should resize constant number? please let me know.

from 1 hand, don't want often, on big sets of data. other hand, don't want waste memory. strategy multiply size 2 (or 1.5, if more concerned memory on performance). doubling adapt possible growth, , predictable number of growth operations.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

C# - WPF - ColumnGroups Footer? (telerik) -

Laravel Bind Multiple Class to One Contract in The Service Provider -