Skip to main content
changed title
Link
Kevin H. Lin
  • 21k
  • 10
  • 116
  • 190

BigO Time complexity of finding the GCD of a set S as a function of sum(S)

spell check will be the death of us all!!!!
Source Link
BCS
  • 205
  • 2
  • 8

The algorithm to be used is:

  • Sort the set into assentingascending order
  • $x_1 = s_1$
  • $x_i = gcd(x_{i-1},s_i)$
  • $GCD = x_n$

What I'm looking for is expected run time as a function of $\sum_{i\in S}i$

As a starting point $|S| \leq \sum_{i\in S} i$ and gcd is $O(ln(n))$ so an upper bound should be $O(n\ln(n))$.

The algorithm to be used is:

  • Sort the set into assenting order
  • $x_1 = s_1$
  • $x_i = gcd(x_{i-1},s_i)$
  • $GCD = x_n$

What I'm looking for is expected run time as a function of $\sum_{i\in S}i$

As a starting point $|S| \leq \sum_{i\in S} i$ and gcd is $O(ln(n))$ so an upper bound should be $O(n\ln(n))$.

The algorithm to be used is:

  • Sort the set into ascending order
  • $x_1 = s_1$
  • $x_i = gcd(x_{i-1},s_i)$
  • $GCD = x_n$

What I'm looking for is expected run time as a function of $\sum_{i\in S}i$

As a starting point $|S| \leq \sum_{i\in S} i$ and gcd is $O(ln(n))$ so an upper bound should be $O(n\ln(n))$.

fixed typos
Source Link
François G. Dorais
  • 44.4k
  • 6
  • 150
  • 233

The algorithm to be used is:

  • Sort the set into assenting order
  • $x_1 = s_1$
  • $x_i = gdc(x_{i-1},s_i)$$x_i = gcd(x_{i-1},s_i)$
  • $GDC = x_n$$GCD = x_n$

What I'm looking for is expected run time as a function of $\sum_{i\in S}i$

As a starting point $|S| \leq \sum_{i\in S}$$|S| \leq \sum_{i\in S} i$ and $gdc$gcd is $O(ln(n))$ so an upper bound should be $O(n\ln(n))$.

The algorithm to be used is:

  • Sort the set into assenting order
  • $x_1 = s_1$
  • $x_i = gdc(x_{i-1},s_i)$
  • $GDC = x_n$

What I'm looking for is expected run time as a function of $\sum_{i\in S}i$

As a starting point $|S| \leq \sum_{i\in S}$ and $gdc$ is $O(ln(n))$ so an upper bound should be $O(n\ln(n))$.

The algorithm to be used is:

  • Sort the set into assenting order
  • $x_1 = s_1$
  • $x_i = gcd(x_{i-1},s_i)$
  • $GCD = x_n$

What I'm looking for is expected run time as a function of $\sum_{i\in S}i$

As a starting point $|S| \leq \sum_{i\in S} i$ and gcd is $O(ln(n))$ so an upper bound should be $O(n\ln(n))$.

deleted 18 characters in body; edited title
Source Link
BCS
  • 205
  • 2
  • 8
Loading
deleted 2 characters in body; deleted 2 characters in body
Source Link
BCS
  • 205
  • 2
  • 8
Loading
Source Link
BCS
  • 205
  • 2
  • 8
Loading