Re: [algogeeks] how to calculate the complexity

2011-07-28 Thread Anish Kumar
Masters' Theorem can be applied only to Divide and Conquer kind of alogs. I would suggest you to read the initial few chapters of Introduction to Algorithms by Cormen. Regards On 28 July 2011 01:16, rajeev bharshetty rajeevr...@gmail.com wrote: Masters Theorem http://esudo apt-get install

Re: [algogeeks] how to calculate the complexity

2011-07-28 Thread Puneet Gautam
Time complexity: int get_power(int a, int b) { if(!b) return 1; if(b%2) return a * get_power(a, b/2); return get_power(a, b/2); } int func(int p) { int sum = 0; for(int i = 1; i = p; ++i) { sum += get_power(i, 5); } return sum; } O(plgp) or O(plg5)..? or anything else..? On 7/28/11, sunny

[algogeeks] how to calculate the complexity

2011-07-27 Thread NITIN SHARMA
Can anybody explain the basic steps that how to calculate the complexity of an algo so that i would be able to find complexity of any program -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send email to

Re: [algogeeks] how to calculate the complexity

2011-07-27 Thread rajeev bharshetty
Masters Theorem http://en.wikipedia.org/wiki/Master_theorem On Thu, Jul 28, 2011 at 1:14 AM, NITIN SHARMA coolguyinat...@gmail.comwrote: Can anybody explain the basic steps that how to calculate the complexity of an algo so that i would be able to find complexity of any program -- You

Re: [algogeeks] how to calculate the complexity

2011-07-27 Thread sunny agrawal
Master theorem can be used when we know the recurrence relation. You can read the 2nd Chapter of CLRS.. On Thu, Jul 28, 2011 at 1:16 AM, rajeev bharshetty rajeevr...@gmail.comwrote: Masters Theorem http://en.wikipedia.org/wiki/Master_theorem On Thu, Jul 28, 2011 at 1:14 AM, NITIN