Tutorial
Tree Terminologies
CO1: Apply an appropriate data structure for a specified problem
1. A tree has 10 nodes and 9 edges. Is it possible for any node to have degree 5?
2. Tree with only one leaf node—what structure?
3. In a tree with n nodes, what is the maximum possible number of leaf nodes?
4. If node A and node B have the same parent P, they are called siblings. If A is the parent
of C, What is the relationship between B and C?
5. How many paths exist between any two nodes in a tree with nodes?
6. Construct a tree with:
a) 7 nodes
b) exactly 3 leaf nodes
c) maximum depth = 3
5. A tree has 15 nodes.
a) What is the maximum possible height?
b) What is the minimum possible height?
6. Consider the given tree.
Answer the following questions:
Nodes & Edges:
a) List all the nodes in the tree.
b) What is the total number of edges?
Levels:
a) Identify which nodes are at Level 1 and Level 2 (assume the root is at Level 0).
Internal Nodes:
a) List all internal nodes in this tree.
Degree of Nodes:
a) What is the degree of node A?
b) What is the degree of node F?
Depth & Height:
a) What is the depth of node G?
b) What is the height of node B?
Tree Height:
a) What is the total height of the tree?