473,511 Members | 15,630 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Trees

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

Thx.
Nov 20 '07 #1
7 1470
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
Nov 20 '07 #2
"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.
Nov 20 '07 #3
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
Nov 20 '07 #4
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.

Nov 20 '07 #5
"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++>
Nov 20 '07 #6
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
Nov 20 '07 #7
On 20 nov, 14:22, Roman Töngi <roman.toe...@hispeed.chwrote:
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
Nov 20 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5403
by: C++ Shark | last post by:
Hi, which stl class is good for creating search trees? I am looking for something flexible, that allows me to search for a required state (of matrices, graphs, etc.) quickly. thanks in...
1
485
by: barnesc | last post by:
Hi again, Since my linear algebra library appears not to serve any practical need (I found cgkit, and that works better for me), I've gotten bored and went back to one of my other projects:...
3
6537
by: ptrSriram | last post by:
Can someone help me with an algorithm to merge two binary search trees. One method I thought of was to flatten both the trees into sorted lists(inorder traversal),merge those two sorted lists,...
8
7803
by: sudharsan | last post by:
please gimme the logic to merge two binary search trees?I mean which node has to be the root node of the new binary tree?? Thanks in advance
2
2042
by: trusiki | last post by:
I am trying to use C# for my program that deals with manipulation of trees (i.e. finding distance between different nodes, assigning labels to nodes, storing trees, etc.). I know I can probably...
17
4455
Ganon11
by: Ganon11 | last post by:
Hey guys, OK, taking care of this beforehand; I AM a student in a university. This IS part of my homework, and (as a moderator), I'm doing my best to follow the posting guidelines I work so hard...
2
2980
by: parasuram | last post by:
Hi friends ............. this is a question regarding the data structures trees Pleas post it if possible with in 2 days I will thankful if some body could help doing this. Operating...
7
3856
by: Vinodh | last post by:
Started reading about Binary Trees and got the following questions in mind. Please help. Definition of a Binary Tree from "Data Structures using C and C++ by Tanenbaum" goes like this, "A...
8
3388
by: Bert | last post by:
How can my response to this problem be better? The pot doesn't work that well when you enter 25, 21, 17 and some others. The problem: CHRISTMAS TREES The grade 5 class at the local primary...
6
2758
by: rsprawls | last post by:
I found a disk for a b-tree algorithm that I purchased back in 93 or so. I'd hoped to find this, but now I'd like to know how worthwhile are b-trees in today's advancements? This is old C code...
0
7242
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7138
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7418
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7075
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7508
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5063
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.