[algogeeks] height of ternary tree

2007-05-01 Thread kiran4u
hi can anyone tell what is the height of complete tree with N nodes in which each parent has three children. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email

[algogeeks] need help for graph problem ...

2007-05-01 Thread mukesh tiwari
hello friends i m trying to solve problem http://online-judge.uva.es/p/v5/523.html in this problem i using floyd's algorithm i m able to figure out total cost but i m not able to figure out the path . may be the reason that i did not understand the algorithm fully and i use it as a black box

[algogeeks] Re: need help for graph problem ...

2007-05-01 Thread Karthik Singaram L
Hi, I guess he is going by the assumption that the queries will be large enough that precomputing the all-pairs shortest paths is better. Anyways..mukesh..this is what you need.. In the place of your output while(cin.get(c) c!='\n') { cin.unget();

[algogeeks] Re: height of ternary tree

2007-05-01 Thread Rajat Jain
Log_base_3 (N) On 5/1/07, kiran4u [EMAIL PROTECTED] wrote: hi can anyone tell what is the height of complete tree with N nodes in which each parent has three children. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[algogeeks] Re: height of ternary tree

2007-05-01 Thread kiran4u
Log_base_3 (N) will be height if last level is at least filled otherwise it fails. Rajat Jain wrote: Log_base_3 (N) On 5/1/07, kiran4u [EMAIL PROTECTED] wrote: hi can anyone tell what is the height of complete tree with N nodes in which each parent has three children.

[algogeeks] Re: height of ternary tree

2007-05-01 Thread kiran4u
sorry small correction Log_base_3 (N) will be height if last level is at least half filled otherwise it fails. On May 2, 9:24 am, kiran4u [EMAIL PROTECTED] wrote: Log_base_3 (N) will be height if last level is at least filled otherwise it fails. Rajat Jain wrote: Log_base_3 (N) On

[algogeeks] Re: height of ternary tree

2007-05-01 Thread Karthik Singaram L
I guess it was a slight difference in terminology...you must have then phrased the question as almost complete rather than a complete tree since you are allowing the last level to be incomplete. Anyways, If the last level is going to be incomplete, then the observe this.. sum of the nodes is