--- Robert Ryan <[EMAIL PROTECTED]> wrote:
> is a vector more like a small linked list if it can
> increase and decrease at will 
> 
> Michael Brown <[EMAIL PROTECTED]> wrote:         
> In java, a vector is basically an array that can
> grow while in runtime.  In other words, it has no
> set length.    

A vector is nothing like a linked list other than they
are both dynamic.  It is a dynamic array.  Elements of
a vector can be accessed using subscripts as in an
array, but you cannot do that using a linked list. 
When a vector grows the basic concept is that it
allocates more space than it currently has and then
copies the data from the current space to the new
space and releases the old space.  With some compilers
the new space is twice the size of the old space, but
I don't think the standard states that this is
required.  Once the space for a vector is allocated,
it will never have less space until the space is
released when it goes out of scope.

Ray



 
____________________________________________________________________________________
Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

Reply via email to