Блог пользователя Duelist1234

Автор Duelist1234, история, 3 года назад, По-английски

What is the time complexity of the Euclidean Algorithm? Also please upvote im really down bad with the downvotes and i want to return to positive contribution. Edit: When i meant the contribution i was hoping to get massivly downvoted.

  • Проголосовать: нравится
  • -12
  • Проголосовать: не нравится

»
3 года назад, скрыть # |
 
Проголосовать: нравится -15 Проголосовать: не нравится

$$$gcd(a, b)$$$ works in $$$log(a) + log(b)$$$ time

»
3 года назад, скрыть # |
 
Проголосовать: нравится +18 Проголосовать: не нравится

Short answer: log(min(a, b)).

Long answer: Stack Overflow my beloved There are multiple explanations for why the time complexity may or may not be something. The case when A and B are very large numbers is also tackled. Really cool!