Ch 7. Trees

Ch 7. Review

7.1 Search, Insertion, Deletion and Sorting

In this section, you learned what trees are, how rooted trees organize data via parent/child relationships, and how key attributes such as level and height describe depth and efficiency. You studied binary trees and the BST property, then practiced the core operations: search, insertion, and deletion. Finally, you saw that in-order traversal yields ascending order in a BST, providing a natural tree-sort workflow: insert all items, then traverse to output the sorted list.

 

7.2 Complexity

This section emphasized that the tree's height determines the running time of BST operations. In a balanced tree, search, insertion, and deletion are [latex]O(\text{log } n)[/latex], while in an unbalanced tree, they can degrade to [latex]O(n)[/latex]. You also analyzed tree sort: when insertions keep the BST balanced, the total cost is [latex]O(n \text{log } n)[/latex] for insertion plus [latex]O(n)[/latex] for traversal. The central takeaway is that maintaining balance preserves the logarithmic benefits that make tree-based structures efficient in practice.

 

7.3 Decision Trees

Here, you explored decision trees as hierarchical models for conditional logic and classification. You learned the parts of the model – root, internal nodes, branches, and leaves – and read an example that combined authentication, authorization, and resource sensitivity into clear decision paths. The section showed how decision trees support real IT tasks and how depth and branching factor relate to the number of possible paths, reinforcing why thoughtful design matters for accuracy, interpretability, and performance.