Time needed to append an array element

How does the time to append an element to an array depend on the size of
the array? Is it practical to build up a large array one element at a
time? Note that for a naive implementation that copies the array for
each element appended, the time required would be proportional the the
square of the final size of the array.

Thanks
Bill Rutiser

On Thu, Apr 10, 2008 at 9:44 AM, William R.
[email protected] wrote:

How does the time to append an element to an array depend on the size of
the array?

http://ruby-doc.org/stdlib/libdoc/benchmark/rdoc/index.html


Avdi

Home: http://avdi.org
Developer Blog: http://avdi.org/devblog/
Twitter: http://twitter.com/avdi
Journal: http://avdi.livejournal.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs