Skip to content

Instantly share code, notes, and snippets.

@vlad-bezden
Last active December 6, 2015 13:12
Show Gist options
  • Save vlad-bezden/4ad4ac42861bc79ce3c4 to your computer and use it in GitHub Desktop.
Save vlad-bezden/4ad4ac42861bc79ce3c4 to your computer and use it in GitHub Desktop.
Euclidean Greatest Common Divisor (GCD) algorithm
public int GCD(int first, int second)
{
return second == 0
? first
: GCD (second, first % second);
}
@vlad-bezden
Copy link
Author

Implementation of Euclidean GCD algorithm in C# using recursion. More information about algorithms can be found at https://en.wikipedia.org/?title=Euclidean_algorithm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment