Objective: Store and Query Hierarchies
It’s common for data to have recursive relationships. Data may be organized in a treelike or hierarchical way. In a tree data structure, each entry is called a node. A node may have a number of children and one parent. The top node, which has no parent, is called the root. The nodes at the bottom, which have no children, are called leaves. The nodes in the middle are simply nonleaf nodes.
In the previous hierarchical data, you may need to query individual items, related subsets of the collection, or the whole collection. Examples of tree-oriented data structures include the following:
Organization chart: |
The relationship of employees to managers is the textbook example of tree-structured data. It appears ... |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access