Okay, so I am trying to write a recursive implementation of Euclid's algorithm for finding the GCD of two ints. I know how to do it non-recursively, but I can't figure out how to get it done recursively. Any help on where to begin?
Posted on 2010-02-27 12:52:53 by program_man
program_man,

Pseudocode: ;-)

unsigned int gcd(unsigned int a, unsigned int b) {
  if (0==a)
    return b;
  else
    return gcd(a%b, b);
}
Posted on 2010-02-27 15:04:41 by baldr