原书出处
Introduction to Algorithms, Fourth Edition
31 第31章 数论算法
B.C.E.) describes the following gcd algorithm, although its origin might be even earlier.
The recursive procedure EUCLID implements Euclid’s algorithm, based directly on Theorem 31.9. The inputs a and b are arbitrary nonnegative integers. EUCLID(a, b) 1 if b == 0 2 return a 3 else return EUCLID(b, a mod b) For example, here is how the procedure computes gcd(30, 21): EUCLID(30, 21) = EUCLID(21, 9) = E
UCLID(9, 3) = EUCLID(3, 0) = 3. This computation calls EUCLID recursively three times. The
原书定位详情
来源:a19c7933-4eda-4176-aebd-30fe7e1ad292
正文位置:extracted/Introduction to Algorithms, Fourth Edition/_epub-src/OEBPS/chapter031.xhtml
EPUB SHA-256:ec7ced04bb875b93983816aef7a667855a4b71c5cf53b63406b9439c74e27aea