Em Andamento

Algorithm analysis

Given an analysis of the running time (Big-Oh notation) for each of the following 4 program fragments. Note that the running time corresponds here to the number of times the operation sum++ is executed. Sqrt is the function that returns the square root of a given number.

(a) sum =0;

for(i=0;<sqrt(n)/2;i++)

sum++;

for(j=0;<sqrt(n)/4;j++)

sum++;

for(k=0;k<8+j;k++)

sum++;

(b) sum = 0;

for(i=0;i<sqrt(n)/2;i++)

for(j=I;8+I;j++)

for(k=j;k<8+j;k++)

sum++;

(c) sum = 0;

for(i=1;i<2*n;i++)

for(j=1;j<i*I;j++)

for(k=1;k<j;k++)

if (j%i==1)

sum++;

(d) sum=0;

for(i=1;i<2*n;i++)

for(j=1;j<i*I;j++)

for(k=1;k<j;k++)

if(j%i)

sum++;

2. if it takes 10ms to run program (b) for n = 100, how long will it take to run for n=400?

[url removed, login to view] it takes 10ms to run program(a) for n = 100, how large a problem can be solved in 40ms?

Habilidades: Programação C++ , Arquitetura de software

Ver mais: program algorithm, problem algorithm, how to algorithm, big oh notation, big oh analysis, big oh, big notation, big 0 notation, algorithm problem, algorithm of programming, algorithm notation, algorithm in programming, algorithm how to, algorithm function, algorithm for programming, algorithm b, 2 sum algorithm, j software, d algorithm, times square, fragments, analysis algorithm, fortran probability density function given, write sentence containing given phrase given web page, handwriting analysis algorithm

Acerca do Empregador:
( 3 comentários ) Houston, United States

ID do Projeto: #5125226

Premiar a:

oobretenov

I could help you. I will do it within 12hours. . . Mais

$35 USD em 1 dia
(3 Avaliações)
2.2

1 freelancer está ofertando em média $35 para este trabalho

pooool

[url removed, login to view] . I have already made similar project. please check my portfolio and note that my completion rate is always 100% so I will follow this for your project as well. I will be waiting to di Mais

$200 USD in 3 dias
(6 Comentários)
4.3