Linked Lists and their usage...

This is a discussion on Linked Lists and their usage... within the C++ Programming forums, part of the General Programming Boards category; I am going to probably start looking at a linked list tutorial I found. I have a question before I ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question Linked Lists and their usage...

    I am going to probably start looking at a linked list tutorial I found. I have a question before I do. What are linked lists for?
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    Me: They are used to store data when it is unknown how much data will be stored.

    You: But, wouldnt dynamically creating an array to that?

    Me: Sure, but the great thing about lists is that inserting and removing nodes is much faster that with arrays. Think about inserting some item in at the front of a 100000000 element array, and think about doing the same with a list.

    You: I see. Thank you so much!

    Me: Your welcome.

  3. #3
    Evil Member
    Join Date
    Jan 2002
    Posts
    638
    Me: But aren't STL vectors and lists better?

    You: But don't I get more flexibility with structure and classes that I make?

    Me: People will have more difficulty reading and adapting your code. Additionally, the STL templates provide a great variety of hard to implement, and especially hard to streamline procedures, such as sorting and culling. Plus, Stroustrup says to prefer the standard unless the standard is not usable.

    You: Well, what about speed?

    Me: You really think you can do better than the thousands of man-hours that have gone into the STL?

    You: ...

    Me: ...?

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    552
    Me: But what if your just learning C++, wouldn't it be better to implement your own version even if just for the experience?

    You: hmmm.... I guess so....

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21