Thread: STL Linked list

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    411

    STL Linked list

    im having a hard time understanding what exactly the stl list is doing?

    Anyone know of a good site on stl or a book perhaps?

  2. #2
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    I can search on google myself, I asked so that someone could send me to a good site that helped them, and not just another one that shows how to sitck a bunch of integers in a list.

  3. #3
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    IMO, the best way to learn about how a linked list works is to program a simple linked list class of your own... it helped me greatly!

    Here's the tutorial I used to make my first linked list class
    And here's the tutorial which I feel much better

  4. #4
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >im having a hard time understanding what exactly the stl list is doing?
    It was designed that way, you don't need to know how std::list works, just how to use it. If it is linked lists that you are interesting in, there are oodles of resources at your local bookstore or online. Try www.accu.com for good book reviews.

    -Prelude
    My best code is written with the delete key.

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    411
    I have coded plenty of linked lists, but im told that stl would probably be more efficient that what I would write.

  6. #6
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    probalby true. In essence the STL linked list class is built on a templated doubly linked list with a multitude of methods to manipulate values in the list. It's neat in that you only have to provide the class to act as the "node" in the list. The class does not need to contain pointer(s) to self like in lists you are used to writing yourself, the compiler provides all that "extra" stuff; you just provide the class data members. Learning about the class methods is reasonably straightforward as each method is reasonably intuitively named and many of the STL container classes use similar methods, so know one classes methods, know them all (well, almost). Of course feeling pretty comfortable with iterators is also helpful, but again the concept of iterators goes throughout STL so once you learn it the knowledge transfers pretty readily to other container classes, etc.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linked List Not Saving Value as Int
    By bar338 in forum C Programming
    Replies: 4
    Last Post: 05-04-2009, 07:53 PM
  2. C++ Linked list program need help !!!
    By dcoll025 in forum C++ Programming
    Replies: 1
    Last Post: 04-20-2009, 10:03 AM
  3. Adding directory/file names to a linked list
    By thoseion in forum C Programming
    Replies: 13
    Last Post: 12-08-2006, 01:13 PM
  4. Contest Results - May 27, 2002
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 06-18-2002, 01:27 PM
  5. 1st Class LIST ADT
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2001, 07:29 PM