Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Data structures or STL

Reply
Thread Tools

Data structures or STL

 
 
utab
Guest
Posts: n/a
 
      03-31-2006
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.

 
Reply With Quote
 
 
 
 
Ben Pope
Guest
Posts: n/a
 
      03-31-2006
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...
 
Reply With Quote
 
 
 
 
utab
Guest
Posts: n/a
 
      03-31-2006

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

 
Reply With Quote
 
Ben Pope
Guest
Posts: n/a
 
      03-31-2006
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...
 
Reply With Quote
 
Jeff Flinn
Guest
Posts: n/a
 
      03-31-2006
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


 
Reply With Quote
 
Noah Roberts
Guest
Posts: n/a
 
      03-31-2006

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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
structures, structures and more structures (questions about nestedstructures) Alfonso Morra C Programming 11 09-24-2005 07:42 PM
Type Casting IPv4 and IPv6 structures to Generic Structures tweak C Programming 14 06-11-2004 02:43 PM
STL Data Structures, Sorted Insertion? Kushal C++ 2 01-30-2004 04:37 PM
Table with complexity of all STL structures, algorithms... Gawelek C++ 0 11-23-2003 06:35 PM
STL data structures using memory wtnt C++ 2 11-11-2003 02:18 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57