[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Implementing a tree in C++/Linux

Posted on 2010-09-10
6
Medium Priority
?
593 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

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…
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

650 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