Greatest common divisor

  • MHB
  • Thread starter matqkks
  • Start date
  • #1
matqkks
284
5
What are the advantages of using Euclid's algorithm over prime decomposition to find the gcd of two numbers?
Should you use Euclid’s algorithm in some cases and prime decomposition in others?
 

Answers and Replies

  • #2
I like Serena
Homework Helper
MHB
16,350
256
What are the advantages of using Euclid's algorithm over prime decomposition to find the gcd of two numbers?
Should you use Euclid’s algorithm in some cases and prime decomposition in others?

Euclid's algorithm is computationally cheaper than prime decomposition.
Prime decomposition is computationally hard, so the only reason to do it, is if the prime decomposition is needed for something else.
In comparison Euclid's algorithm takes a negligible amount of effort. So it can basically be done for free even if prime decomposition is needed for something else.
 

Suggested for: Greatest common divisor

Replies
5
Views
2K
Replies
2
Views
670
Replies
2
Views
836
Replies
7
Views
924
Replies
1
Views
1K
Replies
6
Views
2K
Replies
1
Views
2K
Top