In [here], the GCD (Greatest Common Divisor) is given in brief details. The algorithm can be implemented in both recursive and iterative forms. The recursive formula is , and it has a rough complexity .
The following properties may be used in other solution.
, if a = b
, if a and b are both even.
if a is even and b is odd.
if a and b are both odd.
–EOF (The Ultimate Computing & Technology Blog) —
GD Star Rating
loading...
367 wordsloading...
Last Post: Codeforces: A. System Administrator
Next Post: A Faster Exponentiation Algorithm by Squaring (Power Function)