Euclid's Algorithm is one of the oldest algorithms known to mankind. It was found in Euclid's Elements, something that dates back to 300 B.C.

When Euclid came up with the algorithm, mathematics was not known as it is today; in fact, he used geometrical methods in his discovery, as algebra was not known at that time, as a branch of mathematics.

Euclid's algorithm is used to find the HCF - Highest Common Factor - or GCD - Greatest Common Divider - of two numbers.

The following image shows the steps in the algorithm:

This is the flowchart for the algorithm:

You can practise the algorithm with the following Python code snippet:

If you want to practise the JavaScript version, please follow this link.

## 0 comments:

## Post a Comment