-
January 24th, 2002, 12:15 AM
#1
What's the difference between vector and list in STL ?
I don't know exactlly the difference..
-
January 25th, 2002, 11:48 AM
#2
Re: What's the difference between vector and list in STL ?
A vector is a wrapper arround an array. This means it offers random access iterator that are very fast and can also be used when raw memory pointers are required.
A list is a wrapper for a linked list. This means that it is not continuous memory and random access ([]) is expensive. However, insertion and deletion is always in constant time, in constrast to vector that often require reallocation and copying when inserting or deleting.
_________________________________
Assaf Lavie
-- Rate if it helped --
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|