Build a tree (part 4)

  • 28
  • Locked
Every tree starts with a root, so don't forget to add an Entry<String> field called root with the default access modifier to the CustomTree class. Initialize it in the CustomTree constructor. It's name (elementName) isn't important.
You can't complete this task, because you're not signed in.
Comments (1)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Jurij Thmsn
Level 29 , Flensburg, Germany
23 May 2021, 13:27
Really nice exercise 👍 Hints: don't look for a mathematic logic behind adding the nodes. I thought, odd numbers should always be added to the left and even numbers to the right. Thats not the case, there is no deeper logic to it other than "always add the left node first". make sure the root is added when the customTree is initialized. use a list for storing the nodes.