CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2001
    Location
    Seoul, Korea
    Posts
    47

    What's the difference between vector and list in STL ?

    I don't know exactlly the difference..


  2. #2
    Join Date
    Jan 2001
    Location
    Israel
    Posts
    226

    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
  •  





Click Here to Expand Forum to Full Width

Featured