Help with N-Ary Tree

Hello,
My assignment is to create a Tree that takes cin input and builds a n-ary tree with the following struct.

1
2
3
4
  struct TreeNode {
    int idNumber;
    TreeNode* parent;
    vector<TreeNode*> children;


I then need to traverse the tree and look for cousins. My problem is I am having a very difficult time understanding how to build the tree or traverse it. I barely understand binary trees which seem to be simpler. We went straight from learning about binary trees to implementing our own N-ary tree with very little code or examples on how to implement them so I'm frankly very lost. Can someone explain how inserting new nodes into the above structure would work?
Topic archived. No new replies allowed.