From: Brian Candler Date: 2010-12-20T03:27:30+09:00 Subject: Re: Arrays and Lists ? Emil Macarie wrote in post #969413: > I do see the Array class has an insert method, however assuming that > the implementation of an Array is actually a contiguous array in memory, > the insert method will create a new copy of an array with the insert > element appended. Nope. It grows the memory space, and shuffles the existing elements if necessary (if you're inserting into the middle rather than at the end). I believe it also grows the memory space by more than is needed, so that 10,000 inserts don't require 10,000 grows. > If that is the case how should I (starting with 0 elementS) append and > create a large linked list ? Just append to an empty Array. And relax :-) -- Posted via http://www.ruby-forum.com/.