Data structures or STL

Discussion in 'C++' started by utab, Mar 31, 2006.

  1. utab

    utab Guest

    Dear all,

    I was reading something on data structures on c++ and in that chapter
    it was telling that the same components will be more efficiently
    substituted with the STL ones.

    So can somebody give me some clues? I think that is better to learn the
    STL style than trying to write them with linked lists,pointers and so
    on... Maybe I am mistaken at some points, and hope for your
    understanding :))

    Thanks in advance.
    utab, Mar 31, 2006
    #1
    1. Advertising

  2. utab

    Ben Pope Guest

    utab wrote:
    > Dear all,
    >
    > I was reading something on data structures on c++ and in that chapter
    > it was telling that the same components will be more efficiently
    > substituted with the STL ones.


    If I understand, you are reading a particular book, and it has some
    implementations of data structures, similar to those provided in the
    STL, and recommend you use the STL ones, rather than the book provided ones.

    > So can somebody give me some clues? I think that is better to learn the
    > STL style than trying to write them


    What is "them"?

    > with linked lists,pointers and so
    > on... Maybe I am mistaken at some points, and hope for your
    > understanding :))


    I'm not sure what you mean. I suspect the book example implementations
    are for your learning of data structures, not as a replacement for the
    STL ones.

    Always use the STL where you can.

    Ben Pope
    --
    I'm not just a number. To many, I'm known as a string...
    Ben Pope, Mar 31, 2006
    #2
    1. Advertising

  3. utab

    utab Guest

    Ben Pope wrote:

    > If I understand, you are reading a particular book


    I am reading the C++ How to Program by Deitel and that has a chapter
    called data structures before giving an introduction to STL.

    > What is "them"?


    For example in data structures chapter there are linked list examples
    for inserting back and front, stacks for popping, queues and binary
    tree examples.

    > I'm not sure what you mean. I suspect the book example implementations
    > are for your learning of data structures, not as a replacement for the
    > STL ones.


    That is for sure.
    >
    > Always use the STL where you can.


    Yep got that but this book gives very long examples hard to follow and
    understand the basic idea, do you have a better source to understand
    the basics. I am planning to use the STL for these data structures
    however I would like to learn what is behind as well(at least
    basically).

    Thanks
    utab, Mar 31, 2006
    #3
  4. utab

    Ben Pope Guest

    utab wrote:
    >
    > do you have a better source to understand
    > the basics. I am planning to use the STL for these data structures
    > however I would like to learn what is behind as well(at least
    > basically).


    OK, so you want a book or tutorial on data structures, with a possible
    slant towards C++?

    Ben Pope
    --
    I'm not just a number. To many, I'm known as a string...
    Ben Pope, Mar 31, 2006
    #4
  5. utab

    Jeff Flinn Guest

    utab wrote:

    ....

    > Yep got that but this book gives very long examples hard to follow and
    > understand the basic idea, do you have a better source to understand
    > the basics. I am planning to use the STL for these data structures
    > however I would like to learn what is behind as well(at least
    > basically).


    See "Accelerated C++" by Koenig & Moo

    Jeff
    Jeff Flinn, Mar 31, 2006
    #5
  6. utab

    Noah Roberts Guest

    utab wrote:
    > Dear all,
    >
    > I was reading something on data structures on c++ and in that chapter
    > it was telling that the same components will be more efficiently
    > substituted with the STL ones.
    >
    > So can somebody give me some clues? I think that is better to learn the
    > STL style than trying to write them with linked lists,pointers and so
    > on... Maybe I am mistaken at some points, and hope for your
    > understanding :))


    You should learn how to write your own so that you understand how the
    ones in the STL are working and when to best use which container.
    Also, there are the rare occasions when an STL container is not
    appropriate for your use and you need something different enough that
    you have to write your own. Finally, learning data structures and
    recursion go hand in hand and recursion is definately useful to know.

    So, learn how to make your own....but don't actually do it in real
    projects.
    Noah Roberts, Mar 31, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wtnt
    Replies:
    2
    Views:
    393
    Cy Edmunds
    Nov 11, 2003
  2. Gawelek
    Replies:
    0
    Views:
    396
    Gawelek
    Nov 23, 2003
  3. Kushal
    Replies:
    2
    Views:
    6,196
    tom_usenet
    Jan 30, 2004
  4. tweak
    Replies:
    14
    Views:
    2,755
    Eric Sosman
    Jun 11, 2004
  5. Alfonso Morra
    Replies:
    11
    Views:
    696
    Emmanuel Delahaye
    Sep 24, 2005
Loading...

Share This Page