What is the condition for a tree to be weight balanced. where a is factor and n is a node?

What is the condition for a tree to be weight balanced. where a is factor and n is a node?
A. weight[n.left] >= a*weight[n] and weight[n.right] >= a*weight[n].
B. weight[n.left] >= a*weight[n.right] and weight[n.right] >= a*weight[n].
C. weight[n.left] >= a*weight[n.left] and weight[n.right] >= a*weight[n].
D. weight[n] is a non zero
 
Answer: A
Explanation: The tree is said to be a-balanced if the condition is satisfied. and ‘a’ value will be determined during tree formation. large value of ‘a’ is more effective.
 

Tìm kiếm

Back
Top