Examine this code for GCD:
public static int gcd(int m, int n)
{
if(m==n) return n;
else if(m < n) return gcd(m,n-m);
else return gcd(m-n,n);
}
//WHY DOES THIS WORK???
Subscribe to:
Post Comments (Atom)
Object Oriented Programming Using Java
No comments:
Post a Comment