Tree ADT keys and values, children
I'm still a little confused about the Tree ADT concept when it comes to
keys and values and children.
If a tree has children as TreeNodes in a LinkedList and one of these
children has the value as a text string, and the other child has the value
as an array containing one text string per element.
How should the tree structure then look like?
Should the child with string as value be a leaf?
Should the child with an array as value be a leaf, or should the value
just say "it's an array", and then each array element should be added in
another LinkedList called "childrenList", each as TreeNodes?
Grateful for answers.
No comments:
Post a Comment