Question: TreeNode class: Represents a single node in the supermarket tree. Each node has a name ( such as Dairy or Milk ) , an array
TreeNode class:
Represents a single node in the supermarket tree. Each node has a name such
as "Dairy" or "Milk" an array of children nodes children and the current size
of the children array size
Provides an overloaded constructor to initialize a node with a name and a
capacity for the number of children it can have.
Provides a method addChild to add a child node to the current node
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
