BST Flashcards
1
Q
Total node equations
A
If T has I internal nodes, the number of leaves L = I+1
• If T has I internal nodes, the total number of nodes N = 2I + 1
• If T has a total of N nodes, the number of internal nodes is I = (N-1)/2
• If T has a total of N nodes, the number of leaves is L = (N+1)/2
• If T has L leaves, the total number of nodes is N = 2L – 1
• If T has L leaves, the number of internal nodes is I = L - 1