I have a structure like so:
and I want to loop through all the node's children, then all the children's children then all the children's children's children, etc..
I know one way would be to use recursive functions, but is this the only way?
Also, what's the proper name for this structure? I think it's a tree, but then there's lots of different types of trees. I'd just like to know for future reference.
Edit: after some research I believe it to be a multi-way tree.
Code:
struct node { float x, y, z; std::vector<node> children; };
I know one way would be to use recursive functions, but is this the only way?
Also, what's the proper name for this structure? I think it's a tree, but then there's lots of different types of trees. I'd just like to know for future reference.
Edit: after some research I believe it to be a multi-way tree.
Comment