Ask specific questions about the parts you don't understand. All you posted was a constructor - not much going on there.
Ezzaral
null
16,111 posts since May 2007
Reputation Points: 3,292
Solved Threads: 873
Skill Endorsements: 28
The class tree works similar to a multi-way tree. The different is that you can initialise how many branches (degree) you want in the tree at the constructor level.
//i.e.
NaryTree(4);
//This will create a node with degree of 4 and leaves are not initialised
NaryTree(3, "NewKey");
//This will create a node with degree of 3, and each leave will be set
// to have 3 degree as well.
Nothing else from the class. If you understand a binary tree (always have 2 branches), it works similar to the binary tree but a lot more flexible to use.
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 375
Skill Endorsements: 17
why should i implement a new subtree that all are empty?
So you can add Objects to it later
JamesCherrill
... trying to help
8,519 posts since Apr 2008
Reputation Points: 2,583
Solved Threads: 1,455
Skill Endorsements: 30