z_e_z_e's blog

By z_e_z_e, history, 3 years ago, In English

hello, I want to ask you a question , what is the real time complexity of seive? is it nlog(log(n)) or sqrt(n)log(log(n)) , and why? and whish loop of this code is cost that time complexity ? 1- for(int i=2; i<=n; i++) { 2- if(isprime[i]) 3- { for(int j=i*i; j<=n; j+=i) isprime[j]=0; } }

thanks alot.

Full text and comments »

  • Vote: I like it
  • -17
  • Vote: I do not like it