sorry answer is not 27 its      *""80""*


just consider a binary tree 1st
root has nodes 2^0=1
1st level has 2^1=2
2nd has 2^2=4
so nth level has leaves 2^n

now if we have ternary tree
then follow same procedure just change 3 with 2..
mean at nth level total leaves 3^n

now calculate the level where 28 leaves can have

its not 3^3=27

so it will be 3^4=81

now at 4th level only 28 leaves are filled so its internal level will have
total 80 nodes

if any level has n leaves then total internal nodes=total leaves nodes -1

hence total internal nodes are 80
and total nodes are 80+28

i think u got it....




On Wed, Aug 10, 2011 at 2:38 AM, muthu raj <muthura...@gmail.com> wrote:

> pls explain how u got 27?
> *Muthuraj R
> IV th Year , ISE
> PESIT , Bangalore*
>
>
>
> On Wed, Aug 10, 2011 at 1:13 AM, sagar pareek <sagarpar...@gmail.com>wrote:
>
>> in ques 1 i considered leaves as nodes... if we consider only internal
>> nodes then it have 27
>>
>>
>> On Wed, Aug 10, 2011 at 1:12 AM, sagar pareek <sagarpar...@gmail.com>wrote:
>>
>>> 1.    28+27
>>> 2.    2pow(d)
>>>
>>>
>>> On Wed, Aug 10, 2011 at 12:07 AM, NIKHIL <nikhil.jain.shali...@gmail.com
>>> > wrote:
>>>
>>>> In a ternary Tree No of leaves 28. How many nodes it have?
>>>> An AVL tree with height d. How many children it have?
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "Algorithm Geeks" group.
>>>> To post to this group, send email to algogeeks@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> algogeeks+unsubscr...@googlegroups.com.
>>>> For more options, visit this group at
>>>> http://groups.google.com/group/algogeeks?hl=en.
>>>>
>>>>
>>>
>>>
>>> --
>>> **Regards
>>> SAGAR PAREEK
>>> COMPUTER SCIENCE AND ENGINEERING
>>> NIT ALLAHABAD
>>>
>>>
>>
>>
>> --
>> **Regards
>> SAGAR PAREEK
>> COMPUTER SCIENCE AND ENGINEERING
>> NIT ALLAHABAD
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Algorithm Geeks" group.
>> To post to this group, send email to algogeeks@googlegroups.com.
>> To unsubscribe from this group, send email to
>> algogeeks+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/algogeeks?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@googlegroups.com.
> To unsubscribe from this group, send email to
> algogeeks+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
**Regards
SAGAR PAREEK
COMPUTER SCIENCE AND ENGINEERING
NIT ALLAHABAD

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to