
Answer-first summary for fast verification
Answer: Tree
Arrays (A) and linked lists (B) are linear data structures and are not suitable for representing hierarchical data. Graphs (D) can represent hierarchical data, but they are more complex and may not be the most efficient choice for this specific use case. Trees (C) are non-linear data structures that are specifically designed to represent hierarchical relationships between data elements. They allow for efficient traversal and manipulation of hierarchical data, making them the most appropriate choice for this scenario.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.