is SIve an analysis of the running time (Big-Oh notation) for each of the following 4 program nagments. Note: the running time corresponds here to the number of times the operation sum++ is executed....


is<br>SIve an analysis of the running time (Big-Oh notation) for each of the following 4 program<br>nagments. Note: the running time corresponds here to the number of times the operation sum++ is<br>executed. sqrt is the function that returns the square root of a given number.<br>Program<br>Running time (Big-Oh notation)<br>sum = 0;<br>%3D<br>for(i=0;i<sqrt(n)/2;i++)<br>sum++;<br>for(j=0 ;j<sqrt(n)/4;j++)<br>sum++;<br>for(k=0;k<8+j;k++)<br>sum++;<br>sum<br>%3D<br>for(i=0;i<sqrt(n)/2;i++)<br>for(j=i;8+i;j++)<br>В<br>for (k=j;k<8+j;k++)<br>sum++;<br>sum = 0;<br>%3D<br>for (i=1;i<2*n;i++)<br>for(j=1;j<i*i;j++)<br>for (k=1;k<j;k++)<br>if (j%i==1)<br>sum++;<br>C<br>sum = 0;<br>%3D<br>for(i=1;i<2*n;i++)<br>for (j=1;j<i*i;j++)<br>for(k=1;k<j;k++)<br>if (j%i)<br>sum++;<br>

Extracted text: is SIve an analysis of the running time (Big-Oh notation) for each of the following 4 program nagments. Note: 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. Program Running time (Big-Oh notation) sum = 0; %3D for(i=0;i<8+j;k++) sum++;="" sum="" %3d="" for(i=""><8+j;k++) sum++;="" sum="0;" %3d="" for="" (i=""><2*n;i++) for(j=1;j for(j="">
Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here