TreeNodeclass, the syntax is
new_node = TreeNode(...), replacing
...with the initialisation parameters.
answerarray with a single loop?
next()on the iterator it will return the next element in the collection. When the iterator is "exhausted", i.e. we have reached the end of the collection,