Here I’ve implemented Euclid’s famous functions for calculating the greatest common denominator. I’ve also implemented a slight addition that allows us to calculate the integer coefficients x and y such that d = gcd(a, b) = ax + by. These algorithms were adapted from Thomas Cormen’s exercises on pages 859-860 of Introduction to Algorithms, 2nd [...]
-
Pages
Categories
