Question: Asymtotic Notation a. Consider the following Code-segment: for(i=1; i < N * N * N;i+++) for(j=0; j < N * N;j+++) x+= 1; What can

Asymtotic Notation

a. Consider the following Code-segment:

for(i=1; i < N * N * N;i+++)

for(j=0; j< N * N;j+++)

x+= 1;

What can you say about the running time for this code segment in terms of Big-Oh? be sure to justify your asnwer.

Please explain in detail.

b.Count the operations for the following code sgment and then determine the big-oh in terms of the input size N.

line 1 sum = 0;

line 2 for(i = 0; i * i < N;i++)

line 3 for(j = 0;j * j < N;j++)

line 4 sum++;

line 5 for(k = 0; k < N; k++)

line 6 sum++;

please explain in detail.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!