CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Apr 2009
    Posts
    5

    Container classes

    Hello,

    I am new to Container classes in C++ and would like to know how to use them along with their advantages and disadvantages. Does anyone know of a book that would go over the basics with a few examples of each?

    Thank you.
    Nick.

  2. #2
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Container classes

    There's a pretty good reference here:
    http://www.cplusplus.com/reference/stl/

    As for the advantages/disadvantages, they carry over fairly directly from the nature of the underlying data structure used by each container, eg vector uses an array, list used a doubly linked list, set uses a red/black tree, etc.

  3. #3
    Join Date
    Apr 2009
    Posts
    5

    Re: Container classes

    Thanks Lindley,

    I wanted to the runtime of the program in terms of big O. Using container classes, kind of hinders the understanding, because everything happens in the background. And so, I wanted to understand how they perform the inbuilt functions and their runtimes. If you can give any idea, it'll be great.

    Thanks.
    Nick

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Container classes

    The above page includes a "Complexity" bit for each member function. There are a few side-by-side comparison tables floating around Google.

  5. #5
    Join Date
    May 2007
    Posts
    811

    Re: Container classes

    Well Lindley, you are a better man then I am.

  6. #6
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: Container classes

    Effective STL by Scott Meyers and STL for C++ Programmers.

    http://www.amazon.com/STL-C-Programm.../dp/0471971812
    Thanks for your help.

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