# greatest common divisor

(algorithm)

**Definition:**
(1) The greatest integer which is a divisor of given positive integers. For instance, GCD(30, 42) = 6. (2) An algorithm to find the same.

**Also known as** GCD, highest common factor.

**See also**
*Euclid's algorithm*, *binary GCD*, *least common multiple*, *extended Euclid's algorithm*.

*Note:
After [CLR90, page 804].*

Author: PEB

## Implementation

Flower Brackets (Java).

Go to the
Dictionary of Algorithms and Data
Structures home page.

If you have suggestions, corrections, or comments, please get in touch
with Paul Black.

Entry modified 6 April 2018.

HTML page formatted Fri Apr 6 11:20:42 2018.

Cite this as:

Paul E. Black, "greatest common divisor", in
*Dictionary of Algorithms and Data Structures* [online], Vreda Pieterse and Paul E. Black, eds. 6 April 2018. (accessed TODAY)
Available from: https://www.nist.gov/dads/HTML/greatestCommonDivisor.html