pub fn euclidean_algorithm(a: u64, b: u64) -> u64
Expand description
Performs the Euclidean Algorithm on a
and b
to
calculate the greatest common divisor (GCD) between
a
and b
§Parameters
a
: An unsigned 64-bit integerb
: An unsigned 64-bit integer
§Returns
- An unsigned 64-bit integer representing
the greatest common divisor of
a
andb
§Examples
use dsa::algorithms::intro_algorithm::euclidean_algorithm;
assert_eq!(euclidean_algorithm(20, 5), 5);