GCD of two numbers is the largest number that divides both of them. A simple way to find GCD is to factorize both numbers and multiply common factors.
GCD(10, 15) = 5 GCD(35, 10) = 5 GCD(31, 2) = 1
Time Complexity: O(Log min(a, b))
Please refer complete article on Basic and Extended Euclidean algorithms for more details!
- Java Program for Basic Euclidean algorithms
- Euclidean algorithms (Basic and Extended)
- C Program for Extended Euclidean algorithms
- Pairs with same Manhattan and Euclidean distance
- Find HCF of two numbers without using recursion or Euclidean algorithm
- Basic Operators in Java
- C Program for Program to find area of a circle
- C Program for Program for array rotation
- Lex Program to remove comments from C program
- Number Theory (Interesting Facts and Algorithms)
- Program to calculate value of nCr
- Program to print Hut
- C Program to Add two Integers
- C Program for ID3 Tagging
- How does a C program executes?