Create a new node, link it in the tree and return it.
Create a new node, link it in the tree and return it.
the parent node (null for root)
Return the ith node.
Recursive helper method for generating a tree using a pre-order traversal.
Recursive helper method for generating a tree using a pre-order traversal.
the depth of the tree
the parent node
the level of the node
the birth order of the node
the number of siblings
Randomly generate a color tree.
Randomly generate a color tree.
the depth of the tree
Print the tree.
Animate the generation of the color tree.
Return the number of nodes in the color tree.
The
ColorTree
class provides a data structure for multi-way trees with colored nodes.