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# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -