A rooted tree designates one vertex as the root. Every other vertex has a unique parent, and nodes with no children are leaves.
| Term | Definition |
|---|---|
| Root | Top node; no parent |
| Child / Parent | Directed edge from parent down to child |
| Leaf | Node with no children |
| Height | Longest path from root to any leaf |
| Level of node v | Distance from root to v |
| Subtree | A node plus all its descendants |
A binary tree: each node has at most 2 children (left, right). A Binary Search Tree (BST): all values in the left subtree < node < all values in the right subtree.
A spanning tree of a connected graph uses all vertices with the minimum possible edges (n−1). A minimum spanning tree (MST) minimises total edge weight — solved by Kruskal’s or Prim’s algorithm.
Applications: MSTs appear in network cabling (minimum wire), road planning, cluster analysis, and circuit board layout.
1. A full binary tree has 15 nodes. How many leaves does it have?
2. List the inorder traversal of: root=4, left=2, right=6, 2's children=1,3, 6's children=5,7.
In a rooted tree, a leaf node is defined as
Inorder traversal of a BST produces
BST search has worst-case time complexity
A spanning tree of a graph with n vertices has
Preorder traversal visits nodes in the order