Help creating a tree type data structure (C#)

I'm trying to store a branching string of Vector3s in a variable.

To do this, I figured I had to make my own class.

For a visualization:

Root Node: (0,0,0)
            /   \ 
        (1,2,3)  (4,5,6)
       /  |  \   /  |  \

and so on. I need to be able to dynamically add children and traverse each path and test for certain conditions. Can anyone help me out? Thanks.

It sounds like you want an unbalanced, non-binary tree.

This answer provides a possible implementation of the nodes of such a tree:

Usage of that code would be something like:

NTree<Vector3> vecTree = new vecTree(;

// Add children to root node
vecTree.addChild(new Vector3(1f, 2f, 3f));
vecTree.addChild(new Vector3(4f, 5f, 6f));

// Add a child to first child of the root node [ the one that is (1,2,3) ]
vecTree.getChild(0).addChild(new Vector3(7f, 8f, 9f))