Given a tree with n nodes rooted at given root node r and having values associated with all the nodes. You have to answer two types of queries :- sum
Answers
Answered by
0
Image result for Relationship between height of balanced binary tree and total number of nodes
If binary tree has height h, minimum number of nodes is n+1 (in case of left skewed and right skewed binary tree). For example, the binary tree shown in Figure 2(a) with height 2 has 3 nodes. If binary tree has height h, maximum number of nodes will be when all levels are completely full.
Similar questions