w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Specific tree data structure in java

To answer your question:

  • The Node passed as pNode should be used; you don't need to create a new one.
  • The Board passed as pBoard should be used; you don't need to create a new one.
  • A leaf node has a null mBoard. Alternatively, it could have an mBoard that has an empty mContent array. The choice depends on information you have not posted about how you want your trees to bottom out.

You might consider collapsing your structure. It's not clear why you don't just have a single Node class (with an ArrayList<Node> mContent field in place of the mBoard field).





© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.