Function euclidean_algorithm_recursion

Source
pub fn euclidean_algorithm_recursion(a: u64, b: u64) -> u64
Expand 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 integer
  • b: An unsigned 64-bit integer

§Returns

  • An unsigned 64-bit integer representing the greatest common divisor of a and b

§Examples

use dsa::algorithms::intro_algorithm::euclidean_algorithm_recursion;
 
assert_eq!(euclidean_algorithm_recursion(20, 5), 5);