pub fn euclidean_algorithm_recursion(a: u64, b: u64) -> u64Expand description
Performs the Euclidean Algorithm recursively 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
aandb
§Examples
use dsa::algorithms::intro_algorithm::euclidean_algorithm_recursion;
assert_eq!(euclidean_algorithm_recursion(20, 5), 5);