Trees and Hierarchical Concepts Flashcards
1
Q
What’s the difference between Linked and Arrayed Tree Implementation
A
- Linked Implementation: Uses object instances that refer to each other, like nodes referring to other nodes.
- Arrayed Implementation: Stores the data items of the tree nodes in a single array.
2
Q
What are the key components of a Tree Object?
A
- Initialization: Can be initialized as empty or with a root, left subtree, and right subtree.
- State Querying: Can report if it’s empty and provide the data item in its root node.
- Subtree Access: Can provide references to its left and right subtrees.