Last active
December 6, 2015 13:12
-
-
Save vlad-bezden/4ad4ac42861bc79ce3c4 to your computer and use it in GitHub Desktop.
Euclidean Greatest Common Divisor (GCD) algorithm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int GCD(int first, int second) | |
{ | |
return second == 0 | |
? first | |
: GCD (second, first % second); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Implementation of Euclidean GCD algorithm in C# using recursion. More information about algorithms can be found at https://en.wikipedia.org/?title=Euclidean_algorithm