appacademy / prep-work

preparatory material for interviewing with App Academy
291 stars 339 forks source link

Update 18-greatest-common-factor.rb #64

Closed darth-cy closed 9 years ago

darth-cy commented 9 years ago

Using Euclidean Algorithm can possibly reduce the number of modulo operations. Not sure if the recursive form may build up high stacks tho.....

rglassett commented 9 years ago

Thanks for the contribution; however, since students are not expected to have knowledge of recursion at this point in the application process, I will close this without merging it.

There are a couple flaws in the implementation, as well; in particular I think the arguments to the recursive call should be differences, not remainders.