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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vlnikolic
    New Member
    • Sep 2022
    • 1

    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
  • dev7060
    Recognized Expert Contributor
    • Mar 2017
    • 656

    #2
    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.

    Comment

    Working...