[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Implementing a tree in C++/Linux

Posted on 2010-09-10
6
Medium Priority
?
595 Views
Last Modified: 2012-05-10
Hello,

I'm trying to implement a generic tree structure in a C++ Linux project.  There doesn't seem to be any standard tree container in C++, though.

Does such a container exist?

Thanks,
Tim
0
Comment
Question by:tmitch68
6 Comments
 
LVL 3

Expert Comment

by:packratt_jk
ID: 33648258
Not in standard c++, no.
0
 

Expert Comment

by:shaz_moony
ID: 33648259
yes
0
 

Author Comment

by:tmitch68
ID: 33648282
Can you tell me what it is?
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 3

Assisted Solution

by:packratt_jk
packratt_jk earned 400 total points
ID: 33648293
There might be something in the STL - here's a tutorial for a linked list:

http://www.yolinux.com/TUTORIALS/LinuxTutorialC++STL.html

0
 
LVL 86

Accepted Solution

by:
jkr earned 800 total points
ID: 33648777
Maybe http://tree.phi-sci.com/ ("tree.hh: an STL-like C++ tree class") can help you.
0
 
LVL 32

Assisted Solution

by:phoffric
phoffric earned 800 total points
ID: 33649476
I always thought that an STL map would be implemented by a tree. (They even teach it that way in C++ courses when you have to design your own map.)

Here is one quote from a search to support this view:

"While the C++ standard does not specifically require that the map container be implemented using any specific data structure, the time complexity requirements imposed by the standard for each map operation suggest a balanced binary search tree. Many STL implementations use a red/black tree to implement map. Map operations such as searching for an element or adding an element are O(log n) operations. Logarithmic time complexity for these common operations means that maps are suitable for storing a collection of almost any size, including large collections. Also, map provides bidirectional iterators."

http://frank.mtsu.edu/~csjudy/STL/Map.html
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question