Can you please explain this ques?
Ques 7 Maths & Number theory quiz
Hey @himanshugupta8 the choices given in questions are wrong. They should have used n and h instead of p & q
refer this as it will solve your query Height relationship
I read the article but the height given in ques is from below. So can you please explain me the answer?
So basically it’s asking number of nodes from bottom of the balanced tree at a particular height. So if complete height of tree is 5, so at height 3 there will be 4 nodes and at height 5 there will be 16 nodes. So that’s what for 3 is (3-1)(3-1) = 4
(5-1)(5-1) = 16
That’s why it’s (p-1)*(q-1)
for height h=4, using the formula no. of nodes will be (4-1)*(4-1)= 9, which is definitely wrong. Am I wrong?
See if you want to find the number of nodes with height h, then it will be
2^(h+1)-1
And if you want to calculate nodes For height 4 it will be
2^(4+1)-1-[ 2^(3+1)-1]
That will give you 16, so you will be having 16 nodes at level 4
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Done…