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

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

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.

Полный текст и комментарии »

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