a)
i) Maximum number of nodes of symmetric binary tree with depth of 7 is ---
15
a) 125
b) 127 c) 128
d) 124
Answers
Answer:
Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children of root is 2. The maximum number of nodes on level i of a binary tree is : if level is 3 then there will be maximum 7 nodes in the binary tree.
and the answer is 127
A level number is assigned to each node in a tree. The level number of the tree's root R is usually zero, and every subsequent node is given a level number that is one higher than the level number of its parent. It is the distance from the root.
Depth of a binary tree: The greatest level of any node in the tree is defined as the depth of a binary tree.
The binary tree's depth is equal to 1+ the highest level number.
A symmetric binary tree with depth n has a maximum of -1 nodes.
∴ Given that, depth = n =7
∴ Maximum number of nodes = - 1
∴ Maximum number of nodes = - 1
∴ Maximum number of nodes = 128 - 1
∴ Maximum number of nodes = 127
∴ (b) 127