473,326 Members | 2,136 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

creation of simple tree like structure using stl vector c++, need help : )

hello

i would like to create a tree like structure in c++. since the number of children per node is arbitrary i would like to use stl vector for tree creation.

tree should look something like this:

https://i.postimg.cc/8zzT6jvJ/Diagram1.png

also

each node should contain some data, including one stl vector.

at the end i would like to be able to "merge" hierarchically in one large vector - something like this:

K-vector + I-vector + F-vector + B-vector + A-vector

thank you very much for your interest
Sep 24 '22 #1
1 10883
dev7060
633 Expert 512MB
i would like to create a tree like structure in c++. since the number of children per node is arbitrary i would like to use stl vector for tree creation.

tree should look something like this:

[url]

also

each node should contain some data, including one stl vector.

at the end i would like to be able to "merge" hierarchically in one large vector - something like this:

K-vector + I-vector + F-vector + B-vector + A-vector
You're going to need to write code for this.
Oct 4 '22 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: ghiro | last post by:
as subiect says, i already know how to print a tree structure using a recursive function but what i want is to save the results in a multidimensiona array so i will be able to format them in a...
3
by: Steve Johnson | last post by:
Been banging my head on this for two days now. Hope someone can help! My test program below is in the form of a single JSP, with a Node class build in. (All the coded needed to run is below.) ...
6
by: Amit Varia | last post by:
So I know you can't outright make a simple tree structure in SQL, but I could sure use some help figuring out how get around it. I wanted to develop a simple picture gallery where you put picture...
12
by: pillepop2003 | last post by:
Hey! Can anyone give me a hint, how this problem is best implemented: I have a table of users (see below), where every user has one "superior user" (= parent node), this should be a fully...
4
by: plork | last post by:
I'm trying to code a tree structure using javascript, the nodes of the tree are generated from a sql table. Has anyone some code for this? Cheers
1
by: Srihari | last post by:
I'm trying to develop a tree structure using javascript. The node values of the tree are generating from a mysql table depending on login. The tree structure contains 3 sub levels. I developed...
9
by: Steve Edwards | last post by:
Hi, I have a class which contains a single ptr to another instance which is considered its parent, and an array of ptrs to its children class Nodes{ .... Nodes *mSuper;
1
by: hmoundekar | last post by:
actually i want to generate a tree structure on client side, the application is simple web based, and need to display the data extracted from the database to client in tree structure. but the problem...
4
by: Travis | last post by:
I'm creating a real simple tree. No sorting and every node can have infinite children. // TreeNode.h #ifndef TREENODE_H #define TREENODE_H #include <iostream> #include <iomanip>
8
by: =?ISO-8859-1?Q?m=E9choui?= | last post by:
Problem: - You have tree structure (XML-like) that you don't want to create 100% in memory, because it just takes too long (for instance, you need a http request to request the information from...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.