Data structures or STL

U

utab

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.
 
B

Ben Pope

utab said:
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
 
U

utab

Ben said:
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
 
B

Ben Pope

utab said:
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
 
J

Jeff Flinn

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
 
N

Noah Roberts

utab said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top