Can anybdy sum up, wats the best approach and under what cicumstances ??
--
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
@dave no doubt division is costly, but will time complexity change in your
case ?
On Sat, Sep 10, 2011 at 10:25 PM, Neha Singh wrote:
> the time complexity of my approach : O(a*b)^2
> and of the other approach, i guess : O(a) , where a is the larger no.
> correct me if i m wrong
>
> So, complexi
the time complexity of my approach : O(a*b)^2
and of the other approach, i guess : O(a) , where a is the larger no.
correct me if i m wrong
So, complexity wise my approach does not seem to be gud
--
You received this message because you are subscribed to the Google Groups
"Algorithm Geeks" gro
yup, yours(binary gcd) is better.
On Sat, Sep 10, 2011 at 9:34 PM, Neha Singh wrote:
> How abt dis :
>
> The algorithm reduces the problem of finding the GCD by repeatedly applying
> these identities:
> 1. gcd(0, v) = v, because everything divides zero, and v is the largest
> number that divides
How abt dis :
The algorithm reduces the problem of finding the GCD by repeatedly applying
these identities:
1. gcd(0, v) = v, because everything divides zero, and v is the largest
number that divides v. Similarly, gcd(u, 0) = u. gcd(0, 0) is not typically
defined, but it is convenient to set gcd(0
while(num2 != 0)
{
rem = num1 % num2
num1 = num2
num2 = rem
}
On Sat, Sep 10, 2011 at 8:59 PM, Gaurav Menghani
wrote:
> C'mon
>
> http://en.wikipedia.org/wiki/Greatest_common_divisor
>
> On Sat, Sep 10, 2011 at 11:24 AM, Neha Singh
> wrote:
> >
> > --
> > You received this message because you
C'mon
http://en.wikipedia.org/wiki/Greatest_common_divisor
On Sat, Sep 10, 2011 at 11:24 AM, Neha Singh wrote:
>
> --
> 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 uns
Euclid's GCD Algorithm:
http://www.cs.berkeley.edu/~vazirani/s99cs170/notes/lec3.pdf
On Sat, Sep 10, 2011 at 8:54 PM, Neha Singh wrote:
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to algogeeks@g
--
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
ht