Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Trees

Reply
Thread Tools

Trees

 
 
Roman Töngi
Guest
Posts: n/a
 
      11-20-2007
Are there classes for Trees?
Such as binary trees and binary search trees.

Thx.
 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      11-20-2007
Roman Töngi wrote:
> Are there classes for Trees?
> Such as binary trees and binary search trees.


I am sure there is plenty. Have you looked or did you
just decide to ask here first?

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


 
Reply With Quote
 
 
 
 
osmium
Guest
Posts: n/a
 
      11-20-2007
"Roman Töngi" writes:

> Are there classes for Trees?
> Such as binary trees and binary search trees.


Look at the stuff in <map>. Also see bsearch() in <cstdlib>

_The C++ Standard Library_ by Nicolai Josuttis is invaluable for a serious
C++ programmer. It is useful for both learning and then later as a reference
manual.


 
Reply With Quote
 
Roman Töngi
Guest
Posts: n/a
 
      11-20-2007
I am a beginner. I looked for trees, I didn't
know that one has to implement them on one's own
using maps.

Victor Bazarov wrote:
> Roman Töngi wrote:
>> Are there classes for Trees?
>> Such as binary trees and binary search trees.

>
> I am sure there is plenty. Have you looked or did you
> just decide to ask here first?
>
> V

 
Reply With Quote
 
Roman Töngi
Guest
Posts: n/a
 
      11-20-2007
Thx

Do I have to implement trees on my own using maps if
only the STL is regarded?


osmium wrote:
> "Roman Töngi" writes:
>
>> Are there classes for Trees?
>> Such as binary trees and binary search trees.

>
> Look at the stuff in <map>. Also see bsearch() in <cstdlib>
>
> _The C++ Standard Library_ by Nicolai Josuttis is invaluable for a serious
> C++ programmer. It is useful for both learning and then later as a reference
> manual.
>
>

 
Reply With Quote
 
osmium
Guest
Posts: n/a
 
      11-20-2007
"Roman Töngi" writes:

> Do I have to implement trees on my own using maps if
> only the STL is regarded?


Map is the word used in C++ for a tree. Plug this into google
<map tree associative c++>


 
Reply With Quote
 
Erik Wikstrƶm
Guest
Posts: n/a
 
      11-20-2007
On 2007-11-20 16:55, osmium wrote:
> "Roman T霵gi" writes:
>
>> Do I have to implement trees on my own using maps if
>> only the STL is regarded?

>
> Map is the word used in C++ for a tree. Plug this into google
> <map tree associative c++>


Actually no, a map is a data-structure that maps a key top a value. It
is however true that std::map is (usually) implemented using a
(red-black) tree, but so is std::set. So what the OP needs to clarify is
whether he needs a tree data structure or a container based on a tree
data structure. If it is the latter then std::map or std::set will
probably do fine.

--
Erik Wikstrƶm
 
Reply With Quote
 
mathieu
Guest
Posts: n/a
 
      11-20-2007
On 20 nov, 14:22, Roman Töngi <roman.toe...@hispeed.ch> wrote:
> Are there classes for Trees?
> Such as binary trees and binary search trees.



At some point I was also looking for such structure. But AFAIK they
are not exposed even though they are obvisouly used for std::set o
std::map.
A very stl'ish implementation can be found here:

http://www.aei.mpg.de/~peekas/tree/

HTH
-Mathieu
 
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
Binary search trees (AVL trees) jacob navia C Programming 34 01-08-2010 07:27 PM
B+-trees Rico Java 10 08-02-2004 03:32 PM
Trees in the Java Collections framework Joona I Palaste Java 5 06-09-2004 10:42 AM
Binary Trees jova Java 11 04-26-2004 06:41 AM
Trees in java Pif Java 1 04-06-2004 11:48 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